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)

3 comments
Are you setting the MoveTo to a Part*
Hi, Yes I am asking the script to teleport the plr to a part/brick once they hit their tool against a 'scanner'
okay idk then sorry, but it also looks like you are setting your Cards to a word with the " ". I would set that to a tool