Dodighead147
New Member
- Reaction score
- 0
Hello... A while ago I posted a thread asking how to make it so periodically a peasant steals gold from you. Thanks to the person who helped me, it works now. Here's the code.
The thing is, I want to make it so when the unit dies, it drops the gold as an item, such as a gold coin. Can anyone help me? (this is a very racist game, just warning you.)
Code:
Initialization
Events
Map initialization
Conditions
Actions
Set Unit_Variable = (Random unit from (Units owned by Player 1 (Red) of type Jew))
Code:
Steal
Events
Time - Every 150.00 seconds of game time
Conditions
Actions
Unit - Set the custom value of Unit_Variable to (((Custom value of Unit_Variable) + (Player 1 (Red) Current gold)) / 5)
Player - Set Player 1 (Red) Current gold to (((Custom value of Unit_Variable) - (Player 1 (Red) Current gold)) / 5)
Code:
Killed
Events
Unit - A unit Dies
Conditions
(Dying unit) Equal to Unit_Variable
Actions
Player - Add (Custom value of Unit_Variable) to Player 1 (Red) Current gold
Trigger - Turn off Steal <gen>
The thing is, I want to make it so when the unit dies, it drops the gold as an item, such as a gold coin. Can anyone help me? (this is a very racist game, just warning you.)