Is there a possible fix for this? I don't understand why this is not working :/ It works in studio but not in game...
ScreenGui > TextButton > LocalScript
LocalScript Below.
Character = game.Players.LocalPlayer.Character torso = Character.Torso function onClicked(ScreenGui) torso.CFrame = CFrame.new(Vector3.new(-131.7, 9.3, -30.85)) -- Coordinates end script.Parent.MouseButton1Click:Connect(onClicked)
Make your variables local and use WaitForChild() on your Torso.
local player = game.Players.LocalPlayer local Character = player.Character or player.CharacterAdded:wait() local torso = Character:WaitForChild("Torso") function onClicked() torso.CFrame = CFrame.new(-131.7, 9.3, -30.85) -- Coordinates end script.Parent.MouseButton1Click:Connect(onClicked)