Code: Select all
local GOOMBA_ID = 1
local REDGOOMBA_ID = 2
local flag = false
function onStart()
end
function onTick()
Text.print(flag, 100, 100)
end
function onNPCHarm(eventToken, harmedNPC, killReason, culpritOrNil)
if harmedNPC.id == GOOMBA_ID and killReason == HARM_TYPE_JUMP then
player:kill()
else if harmedNPC.id == GOOMBA_ID and killReason == HARM_TYPE_SPINJUMP then
player:kill()
else if harmedNPC.id == REDGOOMBA_ID and killReason == HARM_TYPE_JUMP then
flag = true
end
end
end
end
function onEvent(eventName)
if eventName == "barrier" then
if flag == true then
triggerEvent("barrier")
end
end
end