Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by
AyeJude 41
6 years ago
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.

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 magicguy78942 238 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

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".

Ad

Answer this question