I made a script that teleports you into a certain room, but it was made to only teleport me. However, this script won't work. I made this so far.
function onTouch(part) local playyer = part.Parent if playyer.Name = ("Player") then local torso = part.Parent:FindFirstChild("Torso") if torso ~= nil then torso.CFrame = CFrame.new(56,26,-94) end end end script.Parent.Touched:connect(onTouch)
It says that it expected a 'then' near the '=' But I have no idea what it means. The script seems fine, I just don't get it.
function onTouch(part) local playyer = part.Parent if playyer.Name == ("Player") then -- When Comparing values, use 2 equal signs, not one. local torso = part.Parent:FindFirstChild("Torso") if torso ~= nil then torso.CFrame = CFrame.new(56,26,-94) end end end script.Parent.Touched:connect(onTouch)