Event
Map initialization
Condition
None
Actions
set (PlayingSlots) = (Player Group matching ((Matching Player) slot equals to (is playing))
Event
A Player leaves
Condition
(Leaving player) in (PlayingSlots)
Actions
Remove (Leaving player) from (PlayingSlots)
set (GoldSplit) = ((Leaving player)'s gold) / (Number of players in (PlayingSlots))
Pick every player in (PlayingSlots) and do (Add (GoldSplit) gold to (Picked player))
AceHart said:Hm... a player that isn't playing can't leave anyway![]()
AceHart said:Oh, it will. I guess.
The condition isn't really needed.
You could alter it to only split among that player's allies for example.
xPheRe said:AceHart is right, the condition in the code I wrote is always true
I didn't know it exactly, so I put it in the trigger
Anyhow, it does the work, doesn't it?![]()
Event
Player 1 leaves the game
Player 2 leaves the game
Player 3 leaves the game..all the way down to player 8
Condition
none
Action
Game - Display to (All players) the text: ((Name of (Triggering player)) + has left the game. All of his/her gold will be split-up among his/her team.)
Set GoldSplit = ((Real(((Triggering player) Current gold))) / (Real((Number of players in (All allies of (Triggering player))))))
Event
Player 1 through 12 leaves
Condition
Action
Wait 3.00 seconds
Game - Display to (All players) for 5.00 seconds the text: ((Name of (Triggering player)) + has left the game.)
Player Group - Pick every player in (All allies of (Triggering player)) and do (If (((Picked player) slot status) Equal to Is playing) then do (Player - Add (((Triggering player) Current gold) / (Number of players in (All players matching ((((Matching player) slot status) Equal to Is playing) and (((Matching player) controller) Equal to User
AddtoplayergroupForce1
Event
Map Initilization
Condition
Action:
Player Group - Add Player 1 (Red) to (All allies of Player 1 (Red))
Player Group - Add Player 3 (Blue) to (All allies of Player 1 (Red))
Player Group - Add Player 2 (Teal) to (All allies of Player 1 (Red))
Player Group - Add Player 4 (Purple) to (All allies of Player 1 (Red))
Add to player group force 2
Event
Map Initilization
Condition
Action:
Player Group - Add Player 5 (Yellow) to (All allies of Player 5 (Yellow))
Player Group - Add Player 6 (Orange) to (All allies of Player 5 (Yellow))
Player Group - Add Player 7 (Green) to (All allies of Player 5 (Yellow))
Player Group - Add Player 8 (Pink) to (All allies of Player 5 (Yellow))
trigger1
Event
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
Condition
Action
Player Group - Remove (Triggering player) from (All allies of Player 1 (Red))
Wait 0.10 seconds
Game - Display to (All players) the text: ((Name of (Triggering player)) + has left the game. All of his/her gold will be split-up among his/her team.)
Player Group - Pick every player in (All allies of Player 1 (Red)) and do (Player - Add (((Triggering player) Current gold) / (Number of players in (All allies of Player 1 (Red)))) to (Picked player) Current gold)
Trigger2
Event
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
Condition
Action
Player Group - Remove (Triggering player) from (All allies of Player 5 (Yellow))
Wait 0.10 seconds
Game - Display to (All players) the text: ((Name of (Triggering player)) + has left the game. All of his/her gold will be split-up among his/her team.)
Player Group - Pick every player in (All allies of Player 5 (Yellow)) and do (Player - Add (((Triggering player) Current gold) / (Number of players in (All allies of Player 5 (Yellow)))) to (Picked player) Current gold)