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

Why is My Variable Not Working? [SOLVED]

Asked by 5 years ago
Edited 5 years ago

Whenever I run the game the script says "attempt to index local 'Player' (a nil value)". Anyone know why it's not working?

script.Parent.MouseButton1Click:Connect(function(Player)
    local leaderstats = Player.leaderstats.Money

Thanks!

0
You're doing lots of things wrong, 1) never change a stat client-side, (enable FE!!), 2) mousebutton1click doesn't have any args, so you need to get the player like this 'game.Players.LocalPlayer' User#20388 0 — 5y
0
I fixed it already. kittonlover101 201 — 5y
0
then add a [SOLVED] or so to the title... User#20388 0 — 5y

Answer this question