My script here is not working and i simply have no idea why.
Nothing about it shows up in the infolog either.
And it should execute since all units of a team get killed.
Code: Select all
-- game_end.lua
-- Provides game end conditions
function gadget:GetInfo()
return {
name = "Game End",
desc = "Provides game end conditions",
author = "Code_Man",
date = "2013-10-30",
license = "Public domain",
layer = 1,
enabled = true
}
end
if (not gadgetHandler:IsSyncedCode()) then
return false
end
function gadget:UnitDestroyed(unit, unitDef, team)
if (Spring.GetTeamUnitCount(team) == 0) then
Spring.KillTeam(team)
--Spring.GameOver()
end
end
function gadget:TeamKilled(team)
Spring.Echo("Player Was Terminated")
end