I have a teleport script inside of a regular script inside of a part. It works fine in studio but in the roblox player. Anyone know a solution?
script.Parent.Parent.touch1.Touched:Connect(function()
local player = workspace:FindFirstChild(game.Players.LocalPlayer.Name)
wait(.5)
player.HumanoidRootPart.CFrame = CFrame.new(Vector3.new(176.303, 1.5, -21.643))
end)

1 comment
is that in a local script or a server script? because LocalPlayer can only be used in local scripts