-- DESCRIPTION: Will play audio specified in and teleport the player to the location of the object specified by . It is better to use a small object or a flat object for your If Used object to avoid getting stuck when you reappear in the level. -- DESCRIPTION: Teleport after [DELAY#=5] seconds g_teleport_withdelay = {} function teleport_withdelay_properties(e, delay) g_teleport_withdelay[e].delay = delay end function teleport_withdelay_init(e) g_teleport_withdelay[e] = {} g_teleport_withdelay[e].delay = 5 g_teleport_withdelay[e].target = GetEntityString(e,0) g_teleport_withdelay[e].started = 0 g_teleport_withdelay[e].timer = 0 end function teleport_withdelay_main(e) if g_teleport_withdelay[e].started == 0 then g_teleport_withdelay[e].timer = 0 if g_Entity[e]['plrinzone'] == 1 then if g_teleport_withdelay[e].target ~= nil then g_teleport_withdelay[e].started = 1 end end elseif g_teleport_withdelay[e].started == 1 then g_teleport_withdelay[e].timer = g_teleport_withdelay[e].timer + GetElapsedTime() Prompt("Teleport in "..g_teleport_withdelay[e].delay - g_teleport_withdelay[e].timer.." seconds") if g_teleport_withdelay[e].timer >= g_teleport_withdelay[e].delay then PlaySound(e,0) TransportToIfUsed(e) g_teleport_withdelay[e].started = 2 Destroy(e) end end end