as bongz has indicated elsewhere, conditionals, player variables, global server variables, user defined variables, sleep/delays in scripts and various methods for retrieving player data have been aded for the latest servers. Full details will follow in the next update of the world owners manual, but for now, heres an example of the sorta thing you can do..
Code: Select all
//----------------- Server Vars
$kServerCigarCount = 1
//------------------ Script constants
$kSpecialValue = 200
$kCigarSmokeDelay = 30 // Seconds
Event( "UseItem", "Cigars" )
{
if ( $PlayerTimeVar[1] < $gServerTime )
{
$gServerVar[$kServerCigarCount] = $gServerVar[$kServerCigarCount] + 1
$playerTimeVar[1] = $gServerTime + $kCigarSmokeDelay
*say %PLAYER% lights up....
Sleep(40) // 1/10ths of a second = 4second delay
*soundeffect 18
*effect %PLAYER% 9
*grantkudos %PLAYER% 1
*say %PLAYER% smoked a cigar ($gPlayerKudos kudos) - $gServerVar[ $kServerCigarCount ] cigars have been smoked
}
else
{
*msg %PLAYER% You can only smoke 1 cigar every $kCigarSmokeDelay seconds
CancelTransaction()
}
}
Event( "PlayerLogin", "" )
{
*msg %PLAYER% Welcome, %PLAYER%, to my special place
*msg %PLAYER% $gServerVar[ $kServerCigarCount ] cigars have been smoked here
}
Event( "&command", "help" )
{
*msg %PLAYER% Thank you, %PLAYER%, for trying the &help command. This command is no help.
}
Event( "UseItem", "Test Item" )
{
*say %PLAYER% produces the jive
*effect %PLAYER% 10
*soundeffect 19
*effect %PLAYER% 1
Sleep(15)
*effect %PLAYER% 5
*effect %PLAYER% 1
*soundeffect 20
Sleep(10)
*effect %PLAYER% 5
*soundeffect 21
Sleep(25)
*effect %PLAYER% 5
}
Oh and theres also a Rand() function, amongst other things :]