I am making a new game Code Hunters 2 opening tomorrow and I am making teleporters so you don't lose your collections. I really need help scripting a teleporter, and I stink at scripting so I used 1 free model and edit some stuff around and here is what I ended up with. Please help me where when u touch a part it teleports you!
NOTE: PLEASE REMAKE THIS SCRIPT IF YOU CAN IF YOU DON'T WANNA PLEASE EDIT IT! I AM IN DESPERATE TIMING WITH MY GAME OPENING TOMORROW!
local Teleport = "SpawnA" --Put the name of the Part between the ""s.
function Touch(hit) --Indicates that the Part has been Touched.
if script.Parent.Locked == false and script.Parent.Parent:findFirstChild(Teleport).Locked == false then script.Parent.Locked = true script.Parent.Parent:findFirstChild(Teleport).Locked = true --Checks Debounce.
local Pos = script.Parent.Parent:findFirstChild(Teleport) --Gets the Part to teleport to.
hit.Parent:moveTo(Pos.Position) wait(1) script.Parent.Locked = false script.Parent.Parent:findFirstChild(Teleport).Locked = false end end --Takes you there and Ends the Function.
script.Parent.Touched:Connect(Touch) --Listens out for Touchers.
