local player = game.Players.LocalPlayer local character = player.Character local textbutton = script.Parent local stairspawn = game.Workspace.StairSpawn textbutton.MouseButton1Click:Connect(function() local humanoidroot = character:FindFirstChild("HumanoidRootPart") if humanoidroot then character.HumanoidRootPart.CFrame = stairspawn.CFrame + Vector3.new(0,3,0) end end)
This script is placed inside a TextButton and it's a LocalScript. If I click it, it will teleport me. However, it doesn't work on servers. Why?
In game press "f9" to see what's happening. Probably your character didn't load quick enough before the script runs.