MojoMojo Posted June 15, 2012 Posted June 15, 2012 (edited) May i use variables on equipments script? Like ....,{ if(variable1>=5){bonus bStr,2;} },{ set variable1,1; },{ set variable1,0; } Edited June 15, 2012 by MojoMojo Quote
F0xxy Posted June 15, 2012 Posted June 15, 2012 You can, but the way that onequip script is wont work when people relog, since they'd have to re-equip the item to set the variable. Quote
Euphy Posted June 15, 2012 Posted June 15, 2012 Yes, it's perfectly valid. Scripts in items are treated the same way as any other script. One important thing to note is that the OnEquip script activates after the itemscript. Quote
MojoMojo Posted June 15, 2012 Author Posted June 15, 2012 (edited) Yes, it's perfectly valid. Scripts in items are treated the same way as any other script. One important thing to note is that the OnEquip script activates after the itemscript. Ok, but if the player relog, the OnEquip doesn't work right? (the player will have to re-equip?) If i dont set the variable to 0, it will be null or will be some trash information? @EDIT ....,{if(variable1==1){bonus bStr,1;} },{set variable1,1;},{set variable1,0;} The script i wrote, it will give the player STR + 1? Edited June 15, 2012 by MojoMojo Quote
malufett Posted June 15, 2012 Posted June 15, 2012 Ok, but if the player relog, the OnEquip doesn't work right? no it still triggers on login/relog... BTW is this an example or the thing you need to do?? { if(variable1>=5){bonus bStr,2;} },{ set variable1,1; },{ set variable1,0; } if yes it's kinda useless....XD Quote
Euphy Posted June 15, 2012 Posted June 15, 2012 Malufett is correct, OnEquip re-triggers for each login. Your script will not trigger, for the reason I stated above. The conditional will trigger before setting the variable. Quote
MojoMojo Posted June 15, 2012 Author Posted June 15, 2012 (edited) Ok, but if the player relog, the OnEquip doesn't work right? no it still triggers on login/relog... BTW is this an example or the thing you need to do?? { if(variable1>=5){bonus bStr,2;} },{ set variable1,1; },{ set variable1,0; } if yes it's kinda useless....XD Yeas, its an example! xD BTW: For this Example works: ....,{if(variable1==1){bonus bStr,1;} },{set variable1,1;},{set variable1,0;} The script i wrote, it will give the player STR + 1? I have to put the set variable1,1; at the first {}? Like: ....,{set variable1,1; if(variable1==1){bonus bStr,1;} },{},{set variable1,0;} Edited June 15, 2012 by MojoMojo Quote
Euphy Posted June 15, 2012 Posted June 15, 2012 Only your last example works. (You can test all of this yourself, too - that's how I'm getting all my information.) Quote
F0xxy Posted June 15, 2012 Posted June 15, 2012 Guess I was wrong then, but still... ....,{set variable1,1; if(variable1==1){bonus bStr,1;} },{},{set variable1,0;} Are you planning to use this somehow or is it also an example? Cause since you'd be equipping the item it wouldn't need a variable to apply the bonus Quote
MojoMojo Posted June 15, 2012 Author Posted June 15, 2012 Only your last example works. (You can test all of this yourself, too - that's how I'm getting all my information.) I can't test by myself cuz of computer.... I can only write the scripts =´/ Thank you: Euphy F0xxy Quote
Question
MojoMojo
May i use variables on equipments script?
Like
Edited by MojoMojo9 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.