Item script that generates random cashpoints

noobsai

New member
Messages
12
Points
0
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
default_smile.png


 
You can simply use this on its code:

#CASHPOINTS += rand(20,50);

Or if you feel safer by using the atcommand:

Code:
atcommand "@cash " + rand(20,50);
 
Hi Thanks jaBote, how do i add a message of how much he get. message will be seen in the chat box

 
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:

Code:
.@addition = rand(20,50);#CASHPOINTS += .@addition;announce "You've earned " + .@addition + " Cash Points. Your current total is " + #CASHPOINTS + " Cash Points.", bc_self;
 
please share. i'm interested
default_smile.png
)
Just make your own item, and make sure its on use script is like this one:

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