Hello, I’m learning to program and I encountered a difficulty with what I want to do.
My idea in this script was that with each click using the tool, a point would be added to the leaderstats. The problem is that the script is not working, and as I’m still learning, I haven’t been able to come up with a solution to understand why it’s not working.
Particularly, I believe it might be a problem with the path I’m providing for the script to find the leaderstats, but I’m not sure if that’s the issue.
I don’t know how to work with leaderstats, so I relied on various scripts from the toolbox and took a look at Roblox’s documentation. That’s where the leaderstats came from.
The problem is that you’re changing the value on a LocalScript, which won’t affect the server. Change your value on a normal script and it should work.
Ignore all i said earlier this is not working because ur doing it on a server side script in which you cannot call the local player if u want to refer to the player do this instead:
local Player = game:GetService("Players"):GetPlayerFromCharacter(script.Parent.Parent)
If this script is a normal script, then you can not use game.Players.LocalPlayer. That only works in a localscript, which is a script that runs on the player’s device(client).