Jump to content
  • 0

- Using Variables on Equipments


MojoMojo

Question


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  114
  • Reputation:   1
  • Joined:  03/07/12
  • Last Seen:  

May i use variables on equipments script?

Like

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

Edited by MojoMojo
Link to comment
Share on other sites

9 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  224
  • Reputation:   22
  • Joined:  03/23/12
  • Last Seen:  

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.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

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.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  114
  • Reputation:   1
  • Joined:  03/07/12
  • Last Seen:  

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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  9
  • Topics Per Day:  0.00
  • Content Count:  554
  • Reputation:   70
  • Joined:  04/04/12
  • Last Seen:  

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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

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.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  114
  • Reputation:   1
  • Joined:  03/07/12
  • Last Seen:  

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
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

Only your last example works. (You can test all of this yourself, too - that's how I'm getting all my information.)

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  224
  • Reputation:   22
  • Joined:  03/23/12
  • Last Seen:  

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

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  114
  • Reputation:   1
  • Joined:  03/07/12
  • Last Seen:  

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

Link to comment
Share on other sites

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.

×
×
  • Create New...