Jump to content
  • 0
Sign in to follow this  
noobsai

Item script that generates random cashpoints

Question

Hi Im really noob in item scripting so i need help.

I make a new item called ticket and I want it to have a function that when used it will generate a cashpoint randomly from 20-50 points

(cashpoint from @cash command)

 

Thanks in advance :)

Share this post


Link to post
Share on other sites

7 answers to this question

Recommended Posts

  • 0

You can simply use this on its code:

#CASHPOINTS += rand(20,50);

 

Or if you feel safer by using the atcommand:

atcommand "@cash " + rand(20,50);

Share this post


Link to post
Share on other sites
  • 0

You should have told me before that, but I think the atcommand method does notify about the user's current cash.

 

If you want to get notified when using the #CASHPOINTS method, use this other code:

.@addition = rand(20,50);#CASHPOINTS += .@addition;announce "You've earned " + .@addition + " Cash Points. Your current total is " + #CASHPOINTS + " Cash Points.", bc_self;

Share this post


Link to post
Share on other sites
  • 0

please share. i'm interested :))

 

Just make your own item, and make sure its on use script is like this one:

.@addition = rand(20,50);#CASHPOINTS += .@addition;announce "You've earned " + .@addition + " Cash Points. Your current total is " + #CASHPOINTS + " Cash Points.", bc_self;

 

 

 

Share this post


Link to post
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.   Restore formatting

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.