function ScriptPostLoad()
DisableSmallMapMiniMap()
EnableSPHeroRules()
-- This is the actual objective setup
TDM = ObjectiveTDM:New{teamATT = 1, teamDEF = 2,
multiplayerScoreLimit = 100,
textATT = "game.modes.tdm",
textDEF = "game.modes.tdm2", multiplayerRules = true, isCelebrityDeathmatch = true}
TDM:Start()
SetProperty("cp2", "IsVisible", 0)
AddAIGoal(1, "Deathmatch", 100)
AddAIGoal(2, "Deathmatch", 100)
AddDeathRegion("deathregion")
ForceHumansOntoTeam1()
firstspawned = 0
onfirstspawn = OnCharacterSpawn(
function(character)
if IsCharacterHuman(character) and firstspawned == 0 then
ShowObjectiveTextPopup("level.DOM.message.1", ATT)
ReleaseCharacterSpawn(onfirstspawn)
end
end
)
timer1 = CreateTimer("timer1")
SetTimerValue(timer1, 1.5)
timer2 = CreateTimer("timer2")
SetTimerValue(timer2, 2.0)
//this part works:
animateobja = OnObjectKill(
function(object, killer)
if GetEntityName(object) == "elevatorconsole" then
PlayAnimation("elevator_open")
StartTimer ("timer1")
testfunction = OnTimerElapse(
function(timer, timer1)
PauseAnimation("elevator_open")
end,
"timer1"
)
end
end
)
//The problem must be somewhere down here
ActivateRegion("doortrigger2")
testfunction2 = OnEnterRegion (
function (enter_region, player)
if IsCharacterHuman(player) then
PlayAnimation ("elevator_close")
StartTimer ("timer1")
end
end,
"doortrigger2"
)
testfunction3 = OnTimerElapse (
function (timer, timer1)
PauseAnimation ("elevator_close")
RewindAnimation ("elevator_open")
PlayAnimation ("elevator_down")
StartTimer("timer2")
end,
"timer1"
)
testfunction4 = OnTimerElapse (
function (timer, timer2)
PauseAnimation ("elevator_down")
RewindAnimation ("elevator_open")
PlayAnimation ("elevator_open")
StartTimer("timer1")
end,
"timer2"
)
testfunction5 = OnTimerElapse (
function (timer, timer1)
PauseAnimation ("elevator_open")
end,
"timer1"
)
//this doesnt work and gives me an error.
soundplayed=0
ActivateRegion("deadtrigger")
testfunction6 = OnEnterRegion (
function (enter_region, player)
if IsCharacterHuman(player) and soundplayed ==0 then
PlaySound("helpme")
soundplayed=1
end
end,
"deadtrigger"
)
end