- Joined
- Apr 1, 2009
- Messages
- 201
I was searching through the forums to find a trigger that divides a players gold and lumber when they leave and I found one. But whenever I try to save my map a message comes up saying "Line #### Expected a code statement" or "Line #### Expected 'Endif' ". I copied the trigger exactly as it was and keep getting the same script error. Anyone know what's wrong?
-
Humans leave
-

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
-


If (All Conditions are True) then do (Then Actions) else do (Else Actions)
-



If - Conditions
-




((Triggering player) slot status) Equal to Is playing
-
-



Then - Actions
-




Game - Display to (All players) the text: ((Name of (Triggering player)) + has deserted Europe..)
-




Multiboard - Set the icon for Multiboard item in column 1, row ((Player number of (Triggering player)) + 2) to ReplaceableTextures\CommandButtons\BTNShadowPact.blp
-




Multiboard - Set the text for Multiboard item in column 2, row ((Player number of (Triggering player)) + 2) to (Player_Colors[14] + ([Left] + (OriginalNames[(Player number of (Triggering player))] + cc_endtag)))
-




Unit Group - Pick every unit in (Units owned by (Triggering player)) and do (Unit - Change ownership of (Picked unit) to (Random player from (All allies of (Triggering player))) and Change color)
-




Custom script: set bj_wantDestroyGroup = true
-
-



Else - Actions
-
-


Set LeavingPlayer = (Triggering player)
-


Set LeavingPlayersLumber = (LeavingPlayer Current lumber)
-


Set LeavingPlayersGold = (LeavingPlayer Current gold)
-


Set AllPlayers = (All allies of Player 1 (Red))
-


Player Group - Remove LeavingPlayer from AllPlayers
-


Player Group - Pick every player in AllPlayers and do (Actions)
-



Loop - Actions
-




Player - Add (LeavingPlayersGold / (Number of players in AllPlayers)) to (Picked player) Current gold
-




Player - Add (LeavingPlayersLumber / (Number of players in AllPlayers)) to (Picked player) Current lumber
-
-
-


Set LeavingPlayersGold = 0
-


Set LeavingPlayersLumber = 0
-


-------- Expected 'Endif' --------
-


Custom script: Call DestroyForce (udg_AllPlayers)
-


-------- Expected 'Endif' --------
-


Custom script: Call DestroyerPlayer (udg_LeavingPlayer)
-
-





