I am new to making scripts and this is my first time making a game in Roblox I have tested this script in the test feature in Roblox Studio and it worked fine, however I tried publishing it to Roblox and it won't work. This is a teleport script BTW. Can some one tell me what I did wrong or how to fix it?
function tele2()
local torso = game.Players.LocalPlayer.Character.UpperTorso
torso.CFrame = game.Workspace.telespawn.CFrame
end
function tele1()
local torso = game.Players.LocalPlayer.Character.UpperTorso
torso.CFrame = game.Workspace.tele1.CFrame
end
while true do
wait(25)
tele1()
wait(133)
tele2()
end

2 comments
https://scriptinghelpers.org/guides/server-client-relationship-in-roblox
Chances are you're using a server script, or you're using a local script wrongfully located. Here's a blog article I wrote a while back on Common Mistakes https://scriptinghelpers.org/blog/common-mistakes