- Joined
- Aug 5, 2010
- Messages
- 147
I have made a trigger that divides the gold of the leaving player by the amount of players that are left in the game, however when their are more than 3 players the gold doesn't get split correctly. See attached images.
When i run the map with 3 players everyone gets the right amount of gold, anything above that and players for some reason get more gold than they should.
When a player leaves i made it so a message appears on screen, this message shows the right amount of gold a player should get, but only when the 1st player leaves, all other messages are broke because of players getting extra gold.
Here is the trigger
When i run the map with 3 players everyone gets the right amount of gold, anything above that and players for some reason get more gold than they should.
When a player leaves i made it so a message appears on screen, this message shows the right amount of gold a player should get, but only when the 1st player leaves, all other messages are broke because of players getting extra gold.
Here is the trigger
-
Player Leave Gold Split
-
Events
- Player - Player 1 (Red) leaves the game
- Player - Player 2 (Blue) leaves the game
- Player - Player 3 (Teal) leaves the game
- Player - Player 4 (Purple) leaves the game
- Player - Player 5 (Yellow) leaves the game
- Player - Player 6 (Orange) leaves the game
- Player - Player 7 (Green) leaves the game
- Player - Player 8 (Pink) leaves the game
- Player - Player 9 (Gray) leaves the game
- Conditions
-
Actions
- Set Players = (Players - 1)
- Set PlayerLeaveGold = ((Triggering player) Current gold)
- Game - Display to (All players matching ((((Matching player) controller) Equal to User) and (((Matching player) slot status) Equal to Is playing))) the text: (((Name of (Triggering player)) + , Has left the game.) + (You have been given + ((|cffFDD017 + (String((PlayerLeaveGold / Players)))) + Gold.|r)))
-
Player Group - Pick every player in (All players matching ((((Matching player) controller) Equal to User) and (((Matching player) slot status) Equal to Is playing))) and do (Actions)
-
Loop - Actions
- Player - Add (((Triggering player) Current gold) / Players) to (Picked player) Current gold
-
Loop - Actions
- Player - Set (Triggering player) Current gold to 0
- Multiboard - Set the text for (Last created multiboard) item in column 3, row Multiboard_Spots[(Player number of (Triggering player))] to (|cffFF0000 + 0)
- Multiboard - Set the text for (Last created multiboard) item in column 1, row MultiBoard_List to (MultiBoard_Colours[(Player number of (Picked player))] + (Player Has Left + |r))
-
Events