Jump to content
  • 0

- Using Variables on Equipments


Question

Posted (edited)

May i use variables on equipments script?

Like

....,{ if(variable1>=5){bonus bStr,2;} },{ set variable1,1; },{ set variable1,0; }

Edited by MojoMojo

9 answers to this question

Recommended Posts

Posted

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.

Posted (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 by MojoMojo
Posted
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

Posted

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.

Posted (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 by MojoMojo
Posted

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

Posted

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...