So I am not sure where to go with this one, I have a script inside a 'scanner' which once the scanner is activated for a specific tool, when the tool 'hit'' the scanner brick, it will TP the player holding such tool to the other side of a gate (to a brick on the other side).
This is what I currently have although it stalls at the point of teleport so not sure where to go from here.
Line 35 is my teleport.
--Variables-- FCCard = "First" BCCard = "Business" PECard = "Priority Class" ECCard = "Economy" Brick = script.Parent Teleport = script.Parent.Parent.Teleport opening = false function OpenGate() if opening == false then opening = true script.Parent.Parent:WaitForChild("Scan").BrickColor = BrickColor.new("Lime green") wait(.1) script.Parent.Parent.Scan.BrickColor = BrickColor.new("Really red") script.Parent.Parent:WaitForChild("LightPart"):WaitForChild("Green").Transparency = 0 script.Parent.Parent:WaitForChild("LightPart"):WaitForChild("Red").Transparency = 1 script.Parent.Parent:WaitForChild("Sound"):Play() wait(1) opening = false script.Parent.Parent.LightPart:WaitForChild("Green").Transparency = 1 script.Parent.Parent.LightPart:WaitForChild("Red").Transparency = 0 else return end end script.Parent.Touched:connect(function(hit) if hit.Parent.Name == FCCard and script.Parent.Parent.Parent.Events.FCOpen.Value == true then hit.Parent.Parent.Parent.Humanoid.HumanoidRootPart:MoveTo(Teleport.Position) OpenGate() elseif hit.Parent.Name == BCCard and script.Parent.Parent.Parent.Events.BCOpen.Value == true then OpenGate() elseif hit.Parent.Name == PECard and script.Parent.Parent.Parent.Events.PEOpen.Value == true then OpenGate() elseif hit.Parent.Name == ECCard and script.Parent.Parent.Parent.Events.ECOpen.Value == true then OpenGate() end end)
This function causes the Humanoid to attempt to walk to the given location by setting the Humanoid.WalkToPoint and Humanoid.WalkToPart properties.
hit.Parent.Parent.Parent.Humanoid.HumanoidRootPart:MoveTo(Teleport.Position)
If the part parameter is not specified, then the position the Humanoid is walking to will not change. Look over this article it explains it pretty well --Roblox developer - MoveTo
Are you setting the MoveTo to a Brick?
AnotherBrick = game.Workspace.AnotherBrick script.Parent.Touched:connect(function(hit) hit.Parent.Parent.Parent.Humanoid.HumanoidRootPart:MoveTo(AnotherBrick.Position) end)