c2greentea Posted July 30, 2014 Posted July 30, 2014 What's wrong with this script? http://upaste.me/r/4d5414074a6c9b54d It is supposed to buffs players that are below lvl 50 but players reported that the npc doesnt buff. Pls help. Willing to tip via Paypal Quote
Radian Posted July 30, 2014 Posted July 30, 2014 (edited) Im sorry didn't read it correctly.. Edited July 30, 2014 by Ginji Quote
Pneuma Posted July 30, 2014 Posted July 30, 2014 What's wrong with this script? http://upaste.me/r/4d5414074a6c9b54d It is supposed to buffs players that are below lvl 50 but players reported that the npc doesnt buff. Pls help. Willing to tip via Paypal if (.@Buffs) { specialeffect2 EF_INCAGILITY; sc_start SC_INCREASEAGI,240000,10; specialeffect2 EF_BLESSING; sc_start SC_BLESSING,240000,10; set HEALDELAY,gettimetick(2)+.@Delay; close; } You don't have anything that checks .@Buffs. if (.@Buffs == 1) { specialeffect2 EF_INCAGILITY; sc_start SC_INCREASEAGI,240000,10; specialeffect2 EF_BLESSING; sc_start SC_BLESSING,240000,10; set HEALDELAY,gettimetick(2)+.@Delay; close; } Quote
Moriarty Posted July 30, 2014 Posted July 30, 2014 What's wrong with this script? http://upaste.me/r/4d5414074a6c9b54d It is supposed to buffs players that are below lvl 50 but players reported that the npc doesnt buff. Pls help. Willing to tip via Paypal if (.@Buffs) { specialeffect2 EF_INCAGILITY; sc_start SC_INCREASEAGI,240000,10; specialeffect2 EF_BLESSING; sc_start SC_BLESSING,240000,10; set HEALDELAY,gettimetick(2)+.@Delay; close; } You don't have anything that checks .@Buffs. if (.@Buffs == 1) { specialeffect2 EF_INCAGILITY; sc_start SC_INCREASEAGI,240000,10; specialeffect2 EF_BLESSING; sc_start SC_BLESSING,240000,10; set HEALDELAY,gettimetick(2)+.@Delay; close; } You clearly don't know how a If works.. @Topic Try to remove this line mes "" + callfunc("Time2Str" ,HEALDELAY); 1 Quote
Pneuma Posted July 30, 2014 Posted July 30, 2014 What's wrong with this script? http://upaste.me/r/4d5414074a6c9b54d It is supposed to buffs players that are below lvl 50 but players reported that the npc doesnt buff. Pls help. Willing to tip via Paypal if (.@Buffs) { specialeffect2 EF_INCAGILITY; sc_start SC_INCREASEAGI,240000,10; specialeffect2 EF_BLESSING; sc_start SC_BLESSING,240000,10; set HEALDELAY,gettimetick(2)+.@Delay; close; } You don't have anything that checks .@Buffs. if (.@Buffs == 1) { specialeffect2 EF_INCAGILITY; sc_start SC_INCREASEAGI,240000,10; specialeffect2 EF_BLESSING; sc_start SC_BLESSING,240000,10; set HEALDELAY,gettimetick(2)+.@Delay; close; } You clearly don't know how a If works.. @Topic Try to remove this line mes "" + callfunc("Time2Str" ,HEALDELAY); I know how it use to work. If they made a change to it to allow it to check without ==,</>=, !=, ||, &&; then that was done while I was away from rA between 2012 and 2014. Quote
Sneaky Posted July 30, 2014 Posted July 30, 2014 There are a few issues in the script you have @c2greentea. The script below should work pretty well. - script Healer -1,{ .@price = 0; // Zeny required for heal .@buffs = 0; // Also buff players? (1: yes / 0: no) .@delay = 10; // Heal delay, in seconds if (@healDelay > gettimetick(2)) { mes callfunc("Time2Str" ,@healDelay)+" seconds to heal again."; close; } if(BaseLevel >= 95) { mes "[Healer]"; mes "My free healing service is only for players below lvl 95. And if you are below lvl 50, you get free buffs!"; mes " "; mes "For players above lvl 95, my charge will be 780 z (w/o buffs). Thank you for your understanding."; mes " "; mes "^777777Delay: 1-3 minutes^000000"; set .@price,780; // Zeny required for heal set .@delay,rand(60,180); // Heal delay, in seconds } else if(BaseLevel < 50) { mes "[Healer]"; mes "My free service is only for players below lvl 95. And if you are below lvl 50, you get free buffs!"; mes " "; mes "^777777Delay: 10 secs^000000"; set .@buffs,1; // Also buff players? (1: yes / 0: no) set .@delay,10; // Heal delay, in seconds } if (.@price) { message strcharinfo(0),"Healing costs "+.@price+" Zeny."; if (Zeny < .@price) { mes "^ff0000You don't have enough Zeny^000000."; message strcharinfo(0),"You don't have enough Zeny."; close; } if(select("^0055FFHeal^000000:^777777Cancel^000000") == 2) close; Zeny -= .@price; } specialeffect2 EF_HEAL2; percentheal 100,100; if (.@buffs) { specialeffect2 EF_INCAGILITY; sc_start SC_INC_AGI,240000,10; specialeffect2 EF_BLESSING; sc_start SC_BLESSING,240000,10; } if (.@delay) @healDelay = gettimetick(2)+.@delay; close; } @Pneuma, just like @Moriarty said, you have no idea whatsoever of basic programming. Quite surprising how you even got that title. Let's just say in athena's scripting when you compare a variable alone, example: if(@variable) it actually checks if it has a value, and if it does, it will execute whatever it is inside the if-statement. if(@variable) //@variable has a value then... { //doThis; } Hope it helps ! Quote
c2greentea Posted July 30, 2014 Author Posted July 30, 2014 Thanks Imp, it finally buffed below lvl50 players but the script cursed the player? http://gyazo.com/16936925966938284497d15ccfc82cf3 How is that possible? Quote
iZeal Posted July 30, 2014 Posted July 30, 2014 are you using he's fulls cript I don't see any SC with stone curse though. Quote
Capuche Posted July 30, 2014 Posted July 30, 2014 You are stone by default (a wrong const --> 0 = SC_STONE) replace SC_INC_AGI by SC_INCREASEAGI Quote
Moriarty Posted July 30, 2014 Posted July 30, 2014 (edited) There are a few issues in the script you have @c2greentea. The script below should work pretty well. - script Healer -1,{ .@price = 0; // Zeny required for heal .@buffs = 0; // Also buff players? (1: yes / 0: no) .@delay = 10; // Heal delay, in seconds if (@healDelay > gettimetick(2)) { mes callfunc("Time2Str" ,@healDelay)+" seconds to heal again."; close; } if(BaseLevel >= 95) { mes "[Healer]"; mes "My free healing service is only for players below lvl 95. And if you are below lvl 50, you get free buffs!"; mes " "; mes "For players above lvl 95, my charge will be 780 z (w/o buffs). Thank you for your understanding."; mes " "; mes "^777777Delay: 1-3 minutes^000000"; set .@price,780; // Zeny required for heal set .@delay,rand(60,180); // Heal delay, in seconds } else if(BaseLevel < 50) { mes "[Healer]"; mes "My free service is only for players below lvl 95. And if you are below lvl 50, you get free buffs!"; mes " "; mes "^777777Delay: 10 secs^000000"; set .@buffs,1; // Also buff players? (1: yes / 0: no) set .@delay,10; // Heal delay, in seconds } if (.@price) { message strcharinfo(0),"Healing costs "+.@price+" Zeny."; if (Zeny < .@price) { mes "^ff0000You don't have enough Zeny^000000."; message strcharinfo(0),"You don't have enough Zeny."; close; } if(select("^0055FFHeal^000000:^777777Cancel^000000") == 2) close; Zeny -= .@price; } specialeffect2 EF_HEAL2; percentheal 100,100; if (.@buffs) { specialeffect2 EF_INCAGILITY; sc_start SC_INC_AGI,240000,10; specialeffect2 EF_BLESSING; sc_start SC_BLESSING,240000,10; } if (.@delay) @healDelay = gettimetick(2)+.@delay; close; } @Pneuma, just like @Moriarty said, you have no idea whatsoever of basic programming. Quite surprising how you even got that title. Let's just say in athena's scripting when you compare a variable alone, example: if(@variable) it actually checks if it has a value, and if it does, it will execute whatever it is inside the if-statement. if(@variable) //@variable has a value then... { //doThis; } Hope it helps ! Actually, not entirely accurate. @variable can have the value 0, returning false. if(.@example). .@example will be true if the value is 1 or higher, will be false if the value is 0. If the var does not exist, the emulator assume the value 0, that's why it return false. In most programming languages, it would return a error if the var doesn't exist. Edited July 30, 2014 by Moriarty Quote
Sneaky Posted July 30, 2014 Posted July 30, 2014 @c2greentea, sorry for the curse thing, I used Euphy's script, didn't even read or browsed through the buffs lol. Should work with @capuche's solution (I guess). @Moriarty, of course, in athena's scripting, 0 means false, to destroy variables you can just set them to 0, that's why I don't count 0 as a value. By any value I mean 1 or higher. Yet again I specified here in athena's scripting, because as you mentioned in most programming languages, it doesn't work that way ! Quote
Question
c2greentea
What's wrong with this script? http://upaste.me/r/4d5414074a6c9b54d
It is supposed to buffs players that are below lvl 50 but players reported that the npc doesnt buff. Pls help. Willing to tip via Paypal
11 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.