Here is my script:
It is supposed to add eight (8) "money" to the player who clicked the image GUI. It is in a localscript.
local image = script.Parent image.MouseButton1Down:connect(function() game.Players.Localplayer.leaderstats["Money"].Value = game.Players.Localplayer.leaderstats["Money"].Value + 8 end)
Nothing happens when I click on the GUI. What is wrong?
Thank you
I think the Error came from line 4 should be
game.Players.LocalPlayer.leaderstats.Money.Value
game.Players.Localplayer
should be
game.Players.LocalPlayer
The reason for this is is because scripts are case-sensitive, and respond to exact key words. If it's misspelled or capitalized incorrectly, scripts will try and do what you told them to do, but it might not reach the same result as intended. In this case, it was finding the player.
Also, check and make sure that your "Money" value is an int value (or a number value, if "Money" has decimal places less than 1).