und34d-rul3
New Member
- Reaction score
- 12
ok im making a casino game and i just finished slot machine trigger and i am wondering if it will work.
it is three triggers and ehre they are
thats for when the person buys the item and checks if they win, and if they lose they lose money and the jackpot gets higher
this is to change the variable i am using for people to win so that it changes there chances every 10 seconds
and this resets the variable if the random number makes it go over 20
please tell me if anything is wrong or if i can improve it (i think i might have to change the second one cause it make make it if they wait a while they will automaticly win
it is three triggers and ehre they are
Code:
Slot machine
Events
Unit - A unit Acquires an item
Conditions
(Item carried by (Buying unit) of type Play Slots (100 gold)) Equal to (Sold Item)
Actions
Item - Remove (Sold Item)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Slot_Machine Equal to 20
Then - Actions
Game - Display to (All players) the text: ((Name of (Owner of (Buying unit))) + Has won the Jackpot for Slots)
Player - Add slot_machine_jackpot to (Owner of (Buying unit)) Current gold
Set Slot_Machine = 0
Else - Actions
Game - Display to (Player group((Owner of (Buying unit)))) the text: You have lost
Player - Add -100 to (Owner of (Buying unit)) Current gold
Set slot_machine_jackpot = (slot_machine_jackpot + 100)
Set Slot_Machine = (Slot_Machine + (Random integer number between 1 and 5))
thats for when the person buys the item and checks if they win, and if they lose they lose money and the jackpot gets higher
Code:
variable
Events
Time - Every 100.00 seconds of game time
Conditions
Slot_Machine Less than 20
Actions
Set Slot_Machine = (Slot_Machine + (Random integer number between 1 and 5))
this is to change the variable i am using for people to win so that it changes there chances every 10 seconds
Code:
slot machine reset
Events
Map initialization
Conditions
Actions
Player Group - Pick every player in (All players) and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Slot_Machine Greater than 20
Then - Actions
Set Slot_Machine = ((Random integer number between 1 and 5) + 0)
Else - Actions
Do nothing
and this resets the variable if the random number makes it go over 20
please tell me if anything is wrong or if i can improve it (i think i might have to change the second one cause it make make it if they wait a while they will automaticly win