This is a basic script that seems to work in studio mode, but not online.
local player = game.Players.LocalPlayer player.leaderstats.Points.Changed:connect(function() script.Parent.Parent:TweenPosition(UDim2.new(0.4, 0, 0.2, 0), "Out", "In", 1.5, true) wait(5) script.Parent.Parent:TweenPosition(UDim2.new(0.4, 0, 1, 0), "Out", "Back", 1.5, true) end)
You can only access the LocalPlayer
property from a LocalScript.
For Script objects, it will always be nil
.
This is because it is not clear which player is "local" when a non-LocalScript is being run -- it's run by the server.
Use a LocalScript instead of a Script; or don't use the LocalPlayer as the way to reference the GUI objects (e.g., script.Parent.Parent.Label
or the equivalent for your path)