Any way of making a teleport brick that will teleport you to another brick?
E.G Let's say I have a brick named 'Brick1' then it should teleport it to 'Brick2',BUT Brick2 should not teleport the player back to Brick1.
local Teleport = "Brick2" function Touch(hit) 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 local Pos = script.Parent.Parent:findFirstChild(Teleport) hit.Parent:moveTo(Pos.Position) wait(1) script.Parent.Locked = false script.Parent.Parent:findFirstChild(Teleport).Locked = false end end script.Parent.Touched:connect(Touch)
local Teleport = "Brick1" function Touch(hit) 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 local Pos = script.Parent.Parent:findFirstChild(Teleport) hit.Parent:moveTo(Pos.Position) wait(1) script.Parent.Locked = false script.Parent.Parent:findFirstChild(Teleport).Locked = false end end script.Parent.Touched:connect(Touch)
Any help would be appreciated!
Thanks, Best of Regards, Gru
These scripts are a bit weird? For the thing you want you need to bricks located in the workspace
Only the first part needs a script:
brick = script.Parent brick2 = workspace.brick2 -- change this to your second brick's name (like workspace.BRICKTOTELEPORTTONAME) brick.Touched:connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then hit.Parent.HumanoidRootPart.CFrame = brick2.CFrame end end)
and a second part to teleport to (named brick2 or edit the code if it isn't named brick2)