See, the problem is that you're tryingto access the startergui, but the startergui is not where the textlabel is currently stored.
So, where is the textlabel stored?
In the playergui, all contents of startergui get cloned to the playergui for every player when he joins
What would be a solution?
You can just make it Player.PlayerGui.Riches.TextLabel.Text, however, I don't recommend that, it will get messy, use script.Parents instead.
Other problems
You didn't make it FE compatible (FE = filtering enabled), to prevent hackers from destroying your game, you should always enable that option, simply put your values inside the player and use some remotes.
Also a FE problem, you cannot access the contents of the playergui with a serverscript!
That's about all, if you need a quick script i recommend just changing game.StarterGui to player.PlayerGui (with player being the player that clicked the button)
But you should never forget FE.
If you have any more questions, just ask.
Edit, this script should work
local click = script.Parent.ClickDetector
click.MouseClick:connect(function(plr)
script.Parent.Sound:Play()
intValue = workspace.Values.Riches.Value
intValue.Value = intValue.Value + 1
plr:WaitForChild('PlayerGui'):WaitForChild('Riches'):WaitForChild('TextLabel').Text = tostring(intValue.Value)
end)
1 comment
Add a new script into the workspace. Type this: local stats = function(plr)