So, I have this problem that is fairly simple.
I am trying to make a tool, where when you have it equipped and that you click (anywhere on the screen), it will give you +1 point in the leaderstats.
(I have already made the leaderstats script and designed the tool.)
Okay, so this is what I did.
(Script inside the tool)
local tool = script.Parent
local leaderstat = game.Workspace.Script
tool.Activated:Connect(function()
leaderstat.Value +1
end)
But it’s giving me an error at
leaderstar.Value + 1
(sorry i’m not good at scripts lol i am a beginner)
No, this is false, Second off, leaderstats should be in the player as a folder, so this is how the script should look
local tool = script.Parent
local Player = tool.Parent.Parent
local leaderstat = Player.leaderstat. -- whatever the value in leaderstat is named
tool.Activated:Connect(function()
leaderstat.Point.Value = leaderstat.Point.Value + 1
end)