questions about scripting... random
- flametard
- Posts: 1245
- Joined: Sun Apr 01, 2007 2:05 am
- Location: Join NR! faction name: 'NR new recruits' password: 'Truth'
- Contact:
questions about scripting... random
can i script a usable item to give a random set of items or actions when used?
- morbydvisns
- Posts: 1889
- Joined: Sun Jan 30, 2005 12:51 am
yes.
heres an example
$action can be whatever you want it to be, its basically a temporary assigned variable that only works during the duration of the script (i call them float variables).
Rand(15) makes the script generate a random number btwn 0(or maybe 1) and 15.
heres an example
Code: Select all
Event( "useitem", "Used item" )
{
$action = Rand(10)
if ( $action = 4 )
{
*do whatever
}
else if ( $action = 5 )
{
*do whatever
}
}
Rand(15) makes the script generate a random number btwn 0(or maybe 1) and 15.