I made this teleport script a while ago when I was learning lua. I stopped scripting for some time and have gone rusty. I cannot understand what some of these lines do. Can someone please explain to me with comments next to each line? Thanks.
button = script.Parent
local player = game.Players.LocalPlayer
repeat wait() until player.Character.Torso
torso = player.Character.Torso
function toReturn()
torso.CFrame = game.workspace.Teleport2.CFrame
end
button.MouseButton1Click:connect(toReturn)

1 comment
Thanks for the help, I also appreciate the tweaks in my code. It looks nicer.