So I'm trying to make a surface guy change to the time a player has been in my game. I got a script for the free model's tab which shows how long a player has been in my game for which works fine but my scripts just not displaying it on a surface GUI.
Here is my script:
while true do
wait(1)
script.Parent.Text = game.Players.LocalPlayer.leaderstats["Time Played"].Value
end
Any help would be really appreciated.

2 comments
the issue is that you're either using a local script in workspace (which doesnt work) or you're using LocalPlayer in a server script (which also doesnt work)
Thanks I moved the script to StarterPlayer and now it's working.