I am pretty new to LUA and the modding in general and I was wondering how you could add gold to the player for each trade routes the player has. This is what I have so far (and it dosen't work):
Code:
function CheckTrading(iPlayer)
local player = Players[iPlayer]
if not player:IsMinorCiv() and player:IsAlive() then
local tradeRoutes = player:GetTradeRoutes()
for id, x in pairs(tradeRoutes) do
player:ChangeGold (500) -- 500 is just for testing
end
end
end
GameEvents.PlayerDoTurn.Add(CheckTrading)
Last edited: