Page 1 of 1

A slot machine

Posted: Wed Jan 09, 2008 2:15 am
by markxxx420
Here is a piece of my slot machine for 420. If anyone has suggestions to make it shorter or only use one item let me know.



Event( "UseItem", "100s chips" )
{
if ( playerinventory("prize 2") > 0 )
{
canceltransaction()
*command=msg %player% you must use your last prize in order to bet again
}
else if ( playerinventory("100s chips") > 6 )
{
$i = rand(30)
*command=setplayervar %player% 4 $i
*command=msg %player% use prize 2 item to see if you win.
*command=grantitem %player% 1 prize 2
}
else
{
canceltransaction()
*command=msg %player% You must have more than 6 100s chips to place a bet.i
}
}
Event( "UseItem", "prize 2" )
{
if ( $playervar4 = 1 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 2 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 3 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 4 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 5 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 6 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 7 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 8 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 9 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 10 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 11 )
{
*command=grantcash %player% 170000
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 12 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 13 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 14 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 15 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 16 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 17 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 18 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 19 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 20 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 21 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 22 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 23 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 24 )
{
*command=grantcash %player% 170000
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 25 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 26 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 27 )
{
*command=msg %player% you lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 28 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 29 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( $playervar4 = 30 )
{
*command=msg %player% YOu lose!
*command=setplayervar %player% 4 0
}
else if ( playerinventory("100s chips") < 6 )
{
canceltransaction()
*command=msg %player% you must keep at least 6 100s chips in your inventory before collecting prize.
}
else
{
canceltransaction()
*command=msg %player% either you should not have this or you're moving too fast! %player%
}
}

Posted: Wed Jan 09, 2008 2:33 am
by markxxx420
Oh, and is there a way to check player cash?
anyone?

Posted: Wed Jan 09, 2008 3:35 am
by zaroba
$gplayercash is cash in deneri.

Posted: Wed Jan 09, 2008 8:06 am
by markxxx420
Here is a roulette script, you can change the commands, prize amounts, and entrance cast by changing a few values.

Event( "&command", "a1" )
{
$i = Rand(36)
if ( $gplayercash < 100 )
{
canceltransaction()
*command=msg %player% you must have more than 1s to play
}
else if ($i = 1)
{
*command=msg %player% The number is 1. You Win.
*command=grantcash %player% 3600
}
else
{
*command=msg %player% The number is $i . You lose
*command=grantcash %player% -100
}
}
Event( "&command", "a2" )
{
$i = Rand(36)
if ( $gplayercash < 100 )
{
canceltransaction()
*command=msg %player% you must have more than 1s to play
}
else if ($i = 2)
{
*command=msg %player% The number is 2. You Win.
*command=grantcash %player% 3600
}
else
{
*command=msg %player% The number is $i . You lose
*command=grantcash %player% -100
}
}
Event( "&command", "a3" )
{
$i = Rand(36)
if ( $gplayercash < 100 )
{
canceltransaction()
*command=msg %player% you must have more than 1s to play
}
else if ($i = 3)
{
*command=msg %player% The number is 3. You Win.
*command=grantcash %player% 3600
}
else
{
*command=msg %player% The number is $i . You lose
*command=grantcash %player% -100
}
}
Event( "&command", "a4" )
{
$i = Rand(36)
if ( $gplayercash < 100 )
{
canceltransaction()
*command=msg %player% you must have more than 1s to play
}
else if ($i = 4)
{
*command=msg %player% The number is 4. You Win.
*command=grantcash %player% 3600
}
else
{
*command=msg %player% The number is $i . You lose
*command=grantcash %player% -100
}
}
Event( "&command", "a5" )
{
$i = Rand(36)
if ( $gplayercash < 100 )
{
canceltransaction()
*command=msg %player% you must have more than 1s to play
}
else if ($i = 5)
{
*command=msg %player% The number is 5. You Win.
*command=grantcash %player% 3600
}
else
{
*command=msg %player% The number is $i . You lose
*command=grantcash %player% -100
}
}
Event( "&command", "a6" )
{
$i = Rand(36)
if ( $gplayercash < 100 )
{
canceltransaction()
*command=msg %player% you must have more than 1s to play
}
else if ($i = 6)
{
*command=msg %player% The number is 6. You Win.
*command=grantcash %player% 3600
}
else
{
*command=msg %player% The number is $i . You lose
*command=grantcash %player% -100
}
}
Event( "&command", "a7" )
{
$i = Rand(36)
if ( $gplayercash < 100 )
{
canceltransaction()
*command=msg %player% you must have more than 1s to play
}
else if ($i = 7)
{
*command=msg %player% The number is 7. You Win.
*command=grantcash %player% 3600
}
else
{
*command=msg %player% The number is $i . You lose
*command=grantcash %player% -100
}
}
Event( "&command", "a8" )
{
$i = Rand(36)
if ( $gplayercash < 100 )
{
canceltransaction()
*command=msg %player% you must have more than 1s to play
}
else if ($i = 8)
{
*command=msg %player% The number is 8. You Win.
*command=grantcash %player% 3600
}
else
{
*command=msg %player% The number is $i . You lose
*command=grantcash %player% -100
}
}
Event( "&command", "a9" )
{
$i = Rand(36)
if ( $gplayercash < 100 )
{
canceltransaction()
*command=msg %player% you must have more than 1s to play
}
else if ($i = 9)
{
*command=msg %player% The number is 9. You Win.
*command=grantcash %player% 3600
}
else
{
*command=msg %player% The number is $i . You lose
*command=grantcash %player% -100
}
}
Event( "&command", "a10" )
{
$i = Rand(36)
if ( $gplayercash < 100 )
{
canceltransaction()
*command=msg %player% you must have more than 1s to play
}
else if ($i = 10)
{
*command=msg %player% The number is 10. You Win.
*command=grantcash %player% 3600
}
else
{
*command=msg %player% The number is $i . You lose
*command=grantcash %player% -100
}
}
Event( "&command", "a11" )
{
$i = Rand(36)
if ( $gplayercash < 100 )
{
canceltransaction()
*command=msg %player% you must have more than 1s to play
}
else if ($i = 11)
{
*command=msg %player% The number is 11. You Win.
*command=grantcash %player% 3600
}
else
{
*command=msg %player% The number is $i . You lose
*command=grantcash %player% -100
}
}
Event( "&command", "a12" )
{
$i = Rand(36)
if ( $gplayercash < 100 )
{
canceltransaction()
*command=msg %player% you must have more than 1s to play
}
else if ($i = 12)
{
*command=msg %player% The number is 12. You Win.
*command=grantcash %player% 3600
}
else
{
*command=msg %player% The number is $i . You lose
*command=grantcash %player% -100
}
}
Event( "&command", "a13" )
{
$i = Rand(36)
if ( $gplayercash < 100 )
{
canceltransaction()
*command=msg %player% you must have more than 1s to play
}
else if ($i = 13)
{
*command=msg %player% The number is 13. You Win.
*command=grantcash %player% 3600
}
else
{
*command=msg %player% The number is $i . You lose
*command=grantcash %player% -100
}
}
Event( "&command", "a14" )
{
$i = Rand(36)
if ( $gplayercash < 100 )
{
canceltransaction()
*command=msg %player% you must have more than 1s to play
}
else if ($i = 14)
{
*command=msg %player% The number is 14. You Win.
*command=grantcash %player% 3600
}
else
{
*command=msg %player% The number is $i . You lose
*command=grantcash %player% -100
}
}
Event( "&command", "a15" )
{
$i = Rand(36)
if ( $gplayercash < 100 )
{
canceltransaction()
*command=msg %player% you must have more than 1s to play
}
else if ($i = 15)
{
*command=msg %player% The number is 15. You Win.
*command=grantcash %player% 3600
}
else
{
*command=msg %player% The number is $i . You lose
*command=grantcash %player% -100
}
}
Event( "&command", "a16" )
{
$i = Rand(36)
if ( $gplayercash < 100 )
{
canceltransaction()
*command=msg %player% you must have more than 1s to play
}
else if ($i = 16)
{
*command=msg %player% The number is 16. You Win.
*command=grantcash %player% 3600
}
else
{
*command=msg %player% The number is $i . You lose
*command=grantcash %player% -100
}
}
Event( "&command", "a17" )
{
$i = Rand(36)
if ( $gplayercash < 100 )
{
canceltransaction()
*command=msg %player% you must have more than 1s to play
}
else if ($i = 17)
{
*command=msg %player% The number is 17. You Win.
*command=grantcash %player% 3600
}
else
{
*command=msg %player% The number is $i . You lose
*command=grantcash %player% -100
}
}
Event( "&command", "a18" )
{
$i = Rand(36)
if ( $gplayercash < 100 )
{
canceltransaction()
*command=msg %player% you must have more than 1s to play
}
else if ($i = 18)
{
*command=msg %player% The number is 18. You Win.
*command=grantcash %player% 3600
}
else
{
*command=msg %player% The number is $i . You lose
*command=grantcash %player% -100
}
}
Event( "&command", "a19" )
{
$i = Rand(36)
if ( $gplayercash < 100 )
{
canceltransaction()
*command=msg %player% you must have more than 1s to play
}
else if ($i = 19)
{
*command=msg %player% The number is 19. You Win.
*command=grantcash %player% 3600
}
else
{
*command=msg %player% The number is $i . You lose
*command=grantcash %player% -100
}
}
Event( "&command", "a20" )
{
$i = Rand(36)
if ( $gplayercash < 100 )
{
canceltransaction()
*command=msg %player% you must have more than 1s to play
}
else if ($i = 20)
{
*command=msg %player% The number is 20. You Win.
*command=grantcash %player% 3600
}
else
{
*command=msg %player% The number is $i . You lose
*command=grantcash %player% -100
}
}
Event( "&command", "a21" )
{
$i = Rand(36)
if ( $gplayercash < 100 )
{
canceltransaction()
*command=msg %player% you must have more than 1s to play
}
else if ($i = 21)
{
*command=msg %player% The number is 21. You Win.
*command=grantcash %player% 3600
}
else
{
*command=msg %player% The number is $i . You lose
*command=grantcash %player% -100
}
}
Event( "&command", "a22" )
{
$i = Rand(36)
if ( $gplayercash < 100 )
{
canceltransaction()
*command=msg %player% you must have more than 1s to play
}
else if ($i = 22)
{
*command=msg %player% The number is 22. You Win.
*command=grantcash %player% 3600
}
else
{
*command=msg %player% The number is $i . You lose
*command=grantcash %player% -100
}
}
Event( "&command", "a23" )
{
$i = Rand(36)
if ( $gplayercash < 100 )
{
canceltransaction()
*command=msg %player% you must have more than 1s to play
}
else if ($i = 23)
{
*command=msg %player% The number is 23. You Win.
*command=grantcash %player% 3600
}
else
{
*command=msg %player% The number is $i . You lose
*command=grantcash %player% -100
}
}
Event( "&command", "a24" )
{
$i = Rand(36)
if ( $gplayercash < 100 )
{
canceltransaction()
*command=msg %player% you must have more than 1s to play
}
else if ($i = 24)
{
*command=msg %player% The number is 24. You Win.
*command=grantcash %player% 3600
}
else
{
*command=msg %player% The number is $i . You lose
*command=grantcash %player% -100
}
}
Event( "&command", "a25" )
{
$i = Rand(36)
if ( $gplayercash < 100 )
{
canceltransaction()
*command=msg %player% you must have more than 1s to play
}
else if ($i = 25)
{
*command=msg %player% The number is 25. You Win.
*command=grantcash %player% 3600
}
else
{
*command=msg %player% The number is $i . You lose
*command=grantcash %player% -100
}
}
Event( "&command", "a26" )
{
$i = Rand(36)
if ( $gplayercash < 100 )
{
canceltransaction()
*command=msg %player% you must have more than 1s to play
}
else if ($i = 26)
{
*command=msg %player% The number is 26. You Win.
*command=grantcash %player% 3600
}
else
{
*command=msg %player% The number is $i . You lose
*command=grantcash %player% -100
}
}
Event( "&command", "a27" )
{
$i = Rand(36)
if ( $gplayercash < 100 )
{
canceltransaction()
*command=msg %player% you must have more than 1s to play
}
else if ($i = 27)
{
*command=msg %player% The number is 27. You Win.
*command=grantcash %player% 3600
}
else
{
*command=msg %player% The number is $i . You lose
*command=grantcash %player% -100
}
}
Event( "&command", "a28" )
{
$i = Rand(36)
if ( $gplayercash < 100 )
{
canceltransaction()
*command=msg %player% you must have more than 1s to play
}
else if ($i = 28)
{
*command=msg %player% The number is 28. You Win.
*command=grantcash %player% 3600
}
else
{
*command=msg %player% The number is $i . You lose
*command=grantcash %player% -100
}
}
Event( "&command", "a29" )
{
$i = Rand(36)
if ( $gplayercash < 100 )
{
canceltransaction()
*command=msg %player% you must have more than 1s to play
}
else if ($i = 29)
{
*command=msg %player% The number is 29. You Win.
*command=grantcash %player% 3600
}
else
{
*command=msg %player% The number is $i . You lose
*command=grantcash %player% -100
}
}
Event( "&command", "a30" )
{
$i = Rand(36)
if ( $gplayercash < 100 )
{
canceltransaction()
*command=msg %player% you must have more than 1s to play
}
else if ($i = 30)
{
*command=msg %player% The number is 30. You Win.
*command=grantcash %player% 3600
}
else
{
*command=msg %player% The number is $i . You lose
*command=grantcash %player% -100
}
}
Event( "&command", "a31" )
{
$i = Rand(36)
if ( $gplayercash < 100 )
{
canceltransaction()
*command=msg %player% you must have more than 1s to play
}
else if ($i = 31)
{
*command=msg %player% The number is 31. You Win.
*command=grantcash %player% 3600
}
else
{
*command=msg %player% The number is $i . You lose
*command=grantcash %player% -100
}
}
Event( "&command", "a32" )
{
$i = Rand(36)
if ( $gplayercash < 100 )
{
canceltransaction()
*command=msg %player% you must have more than 1s to play
}
else if ($i = 32)
{
*command=msg %player% The number is 32. You Win.
*command=grantcash %player% 3600
}
else
{
*command=msg %player% The number is $i . You lose
*command=grantcash %player% -100
}
}
Event( "&command", "a33" )
{
$i = Rand(36)
if ( $gplayercash < 100 )
{
canceltransaction()
*command=msg %player% you must have more than 1s to play
}
else if ($i = 33)
{
*command=msg %player% The number is 33. You Win.
*command=grantcash %player% 3600
}
else
{
*command=msg %player% The number is $i . You lose
*command=grantcash %player% -100
}
}
Event( "&command", "a34" )
{
$i = Rand(36)
if ( $gplayercash < 100 )
{
canceltransaction()
*command=msg %player% you must have more than 1s to play
}
else if ($i = 34)
{
*command=msg %player% The number is 34. You Win.
*command=grantcash %player% 3600
}
else
{
*command=msg %player% The number is $i . You lose
*command=grantcash %player% -100
}
}
Event( "&command", "a35" )
{
$i = Rand(36)
if ( $gplayercash < 100 )
{
canceltransaction()
*command=msg %player% you must have more than 1s to play
}
else if ($i = 35)
{
*command=msg %player% The number is 35. You Win.
*command=grantcash %player% 3600
}
else
{
*command=msg %player% The number is $i . You lose
*command=grantcash %player% -100
}
}
Event( "&command", "a36" )
{
$i = Rand(36)
if ( $gplayercash < 100 )
{
canceltransaction()
*command=msg %player% you must have more than 1s to play
}
else if ($i = 36)
{
*command=msg %player% The number is 36. You Win.
*command=grantcash %player% 3600
}
else
{
*command=msg %player% The number is $i . You lose
*command=grantcash %player% -100
}
}

Posted: Thu Jan 10, 2008 9:34 pm
by zaroba
seeing these makes me want to finish my full blackjack script.
hmm...if only i can remember what needed to be finished on it :P

on a side note, do you mind if i make a more complex version of that slot machine script? mainly one that accurately replicates real slot machines. ie, using 3 numbers instead of 1 and possibly a grid of 9 for several chances to win based on the amount bet.