You are using game.StarterGui, the startergui replicates to everyone in the form of player gui,
Basically all you have to do is change game.StarterGui to script.Parent depending on where your script is placed… Or I am unsure if this will work but try doing player.PlayerGui from the localscript.
First, changing StarterGui wouldn’t change anything in a local script. You would define it through either PlayerGui or by finding the objects in relation to the script’s location (recommended)
Second, where is your localscript in relation to the textlabels?
Third, have you tried adding using WaitForChild() on leaderstats in your original code?
He uses those lines to define the value right when the player joins, as the getpropertychangedsignal wouldn’t activate until after the initial values have been set.
Really? I’m pretty sure it works fine without defining the values at first (I mean the value shoudn’t be nil) Also like you said he should probably use WaitForChild on leaderstats.
Edit: I just realised I’m wrong lol. It’s probably best to define the values at first, as you don’t want your GetPropertyChangedSignal to be erroring.
Try putting them in a while loop like this so it checks the coint every seond
while wait(1) do
local player = game.Players.LocalPlayer
game.StarterGui.Stats.Coins.TextLabel.Text = player.leaderstats:WaitForChild("Coins").Value
game.StarterGui.Stats.Rebirths.TextLabel.Text = player.leaderstats:WaitForChild("Rebirths").Value
player.leaderstats.Coins:GetPropertyChangedSignal("Value"):Connect(function()
game.StarterGui.Stats.Coins.TextLabel.Text = player.leaderstats:WaitForChild("Coins").Value
end)
player.leaderstats.Rebirths:GetPropertyChangedSignal("Value"):Connect(function()
game.StarterGui.Stats.Rebirths.TextLabel.Text = player.leaderstats:WaitForChild("Rebirths").Value
end)
end