Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why does this script work in roblox studio but no in actual server?

Asked by 8 years ago

Ive opened up the console and it says player is a nil value but it works in roblox studio help? My script only works in a script not local. Here it is

wait(1)

player = game.Players.LocalPlayer

button = script.Parent

local debounce = false

function teleport() if not debounce then

debounce = true
torso = player.Character.Torso
torso.CFrame = game.Workspace.plswork.CFrame

end

end

local allow = ( game.CreatorId == player.userId

) if allow then

m = Instance.new("Message", game.Workspace)

m.Text = "Welcome Admins"

wait(2)

m:Remove()

teleport()

end
0
It would help if you had your code in a code block /: User#11440 120 — 8y

1 answer

Log in to vote
0
Answered by
Ulysies 50
8 years ago

Heres a link that might help. ;) https://scriptinghelpers.org/blog/it-works-in-studio-but-not-online

Ad

Answer this question