--script by smallg Modified by Myke Price -- range to be able to use teleporter local use_range = 120 --key to use teleporter local input_key = "e" --entity number of real pad used to port to --put name of this entity inside the 'ifused' field of teleporter local port_pad = 2 --delay until port --rx = 1 is 1 second / rx = 10 is 10 seconds / etc local rx = 3 --number of destinations --*you must set names and target entity numbers for these in the init(e) part* local max_dest = 3 ---- local dest_number = {} local levelname = {} local state = {} local pressed = 0 local delay = 0 local x = 50 local y = 10 local dest = 1 local rx_init = rx function teleport_other_maps_init(e) --input entity number of area's here --***not really needed dest_number[1] = 4 dest_number[2] = 5 dest_number[3] = 6 --dest_number[4] = 16 --dest_number[5] = 17 --dest_number[6] = 18 --dest_number[7] = 19 --dest_number[8] = 21 --dest_number[9] = 22 --name area's here ** Enter the name of you jump to levels levelname[1] = "telleval1" levelname[2] = "tellevel2" levelname[3] = "tellevel3" --destination[4] = "level4" --destination[5] = "level5" --destination[6] = "level6" --destination[7] = "level7" --destination[8] = "level8" --destination[9] = "level9" state[e] = "init" end --init function teleport_other_maps_main(e) if state[e] == "init" then if GetPlayerDistance(e) <= use_range then PromptLocal(e,"Press " .. input_key .. " to power on teleporter") if g_InKey == input_key and pressed == 0 then state[e] = "select dest" pressed = 1 rx = rx_init FreezePlayer() CollisionOff(port_pad) SetPosition(port_pad,g_PlayerPosX,g_PlayerPosY,g_PlayerPosZ) y = 10 end end elseif state[e] == "select dest" then for a = 1, max_dest do --if you have bigger destination names then make the panel here bigger --format = Panel(x1,y1,x2,y2) Panel(35,y-5,65,y+4.5) TextCenterOnXColor(x,y,3,a .. " = " .. levelname[a],205,5,205) y = y + 10 if g_Scancode == a+1 and pressed == 0 then pressed = 1 dest = a delay = GetTimer(e) PromptDuration("Porting in " .. rx .. " : Destination = " .. levelname[dest],1000) state[e] = "porting" LoopSound(e,0) end end y= 10 elseif state[e] == "porting" then if rx > -1 then if GetTimer(e) > delay then PromptDuration("Porting in " .. rx .. " : Destination = " .. levelname[dest],1000) delay = GetTimer(e) + 1000 rx = rx - 1 end else StopSound(e,0) CollisionOff(dest_number[dest]) -- Remmed out by Myke --SetPosition(port_pad,g_Entity[dest_number[dest]]['x'],g_Entity[dest_number[dest]]['y'],g_Entity[dest_number[dest]]['z']) UnFreezePlayer() --Remmed out by Myke to use different command. --TransportToIfUsed(e) JumpToLevel(levelname[dest]) --Not really needed as the screen fades to black. --PromptDuration("You have reached " .. levelname[dest],2000) state[e] = "init" -- ** thinking about destroying the script hear, but then it become linear. Not optimal. end end --state --reset input if pressed == 1 and g_InKey == "" then pressed = 0 end end --main function teleport_other_maps_exit(e) end --exit