game.Players.LocalPlayer.leaderstats.Zimo.Changed:Connect(function() script.Parent.Text = game.Players.LocalPlayer.leaderstats.Zimo.Value end)
Im trying to get this to constantly check the value/currency or when the player connects cause I have a data store set up and when a player joins it doesn't update the value.
I have also tried
game.Palyers.PlayerAdded:Connect(function() script.Parent.Text = game.Players.LocalPlayer.leaderstats.Zimo.Value end)
But I can't get it to work its my first time coding on roblox and basically anything and im trying to get into it so if i could get some help that would be amazing!
I'm writing this from the top of my head, so i'm not sure if this script will function properly (Also i recommend looking up FilteringEnabled in the near future)
-This Code is an example by the way, if you are going to use it then make sure to just update the variables n' stuff
local Player = game.Players.LocalPlayer local Zimo = Player:WaitForChild("leaderstats"):WaitForChild("Zimo") script.Parent.Text = Zimo.Value Zimo.Changed:connect(function() script.Parent.Text = Zimo.Value end)
i think this will work, im not sure though
You could do a loop to constantly check for any changes but Lunaify's method would be better to use.
local Player = game.Players.LocalPlayer local Zimo = Player:WaitForChild("leaderstats"):WaitForChild("Zimo") while true do wait() script.Parent.Text = Zimo.Value end)
Or
local Player = game.Players.LocalPlayer local Zimo = Player.leaderstats.Zimo Zimo.Changed:connect(function() script.Parent.Text = Zimo.Value end)