Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Can you help me edit my money script so it can actually do what it is assigned to do?

if game.Workspace:FindFirstChild("Gem") then
game.Workspace.Gem.ClickDetector.MouseClick:connect(function()

local Player = game:GetService("Players").LocalPlayer
local Life = game.Player.leaderstats.Life

Life.Value = Life.Value + 10

end)
end

Any help would be appreciated.

1 comment

0

Don't really put the function inside a condition check because It will always be connected and It can't be disconnected unless you disconnect the RBXSignal from outside the conditional check

1 answer

✓ Accepted answer

You can't find leaderstats in game.Player, the leaderstats are under the variable you already had set. You just need to take game out of the variable "Life".

This discussion is preserved as it was. New answers, comments, and votes are closed.