1 | wait() |
2 | script.Parent.Text = "Gems: " .. game.Players.LocalPlayer.Gems.Value |
ok, this is how I did points for my game: you have to do this: also, make sure that "Gems" is in starter player then
1 | while true do : |
2 | script.Parent.Text - "Gems: " .. game.Players.LocalPlayer.Gems.Value |
3 | wait() -- try adding a wait, that might clear it up |
4 | end |
I think you would be better off just checking whenever the value changes, perhaps like this
1 | game.Players.LocalPlayer.Gems.Changed:Connect( function () |
2 | script.Parent.Text = "Gems: " .. game.Players.LocalPlayer.Gems.Value |
3 | end ) |
I'm on mobile so it might not be exactly right but hopefully you get the idea
The reason it crashes when you use a while loop is because you need a wait() when using it.
1 | while true do |
2 | wait() |
3 | script.Parent.Text = "Gems: " ..game.Players.LocalPlayer.Gems.Value |
4 | end |
Though I'd just detect whenever the value is changed then change the text.
1 | game.Players.LocalPlayer.Gems:GetPropertyChangedSignal( "Value" ):Connect( function () -- Or, if you wanted to, you could just do the .Changed event. |
2 | script.Parent.Text = "Gems: " ..game.Players.LocalPlayer.Gems.Value |
3 | end ) |