Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How come it doesn't teleport me in server, but works in studio?

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?

1 answer

In game press "f9" to see what's happening. Probably your character didn't load quick enough before the script runs.

This discussion is preserved as it was. New answers, comments, and votes are closed.