I am making an elevator and when a player clicks a button it teleports them but it doesn't work. There are no errors in the output.
Script:
wait(1)
player = game.Players.LocalPlayer
function teleport()
torso = player.Character.Torso
torso.CFrame = CFrame.new(game.Workspace.Floor2Ele.Part.CFrame)
end
script.Parent.ClickDetector.MouseClick:connect(teleport)

2 comments
Edited.
Edited[2]