Here's my code:
tmps=0
local preFixes = {"01", "02", "03", "04" , "05", "06", "07", "08", "09", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21" }
local PlayerCrashSpit = {}
for i = 1, 21 do
PlayerCrashSpit[i]=SET_UNIT:New():FilterCategories("plane"):FilterStart("Pilot_Spit #0".. preFixes[i] ):FilterStart()
PlayerCrashSpit=PlayerCrashSpit[i]
PlayerCrashSpit:HandleEvent( EVENTS.Crash )
function PlayerCrashSpit:OnEventCrash( EventData )
if timer.getTime() - tmps >2 then
tmps=timer.getTime()
nom = EventData.IniPlayerName
Scoring:AddGoalScorePlayer( nom, "Pilot, it's crashed.", nom.." it's crashed -5", -5 )
end
end
end
I use Moose, this code works very well locally and when I create a server but as soon as there is more than one player on the server it doesn't work anymore. ???
Please help !