Shop gui not working

Hello, this is a script for my shop gui.
On line 9 i get this error.

https://gyazo.com/f1251da06bea1725566de5b15baa30d0


https://gyazo.com/3f36c33aab968423af9ed7402ffb00a3
This is the script. (Line 9 is the one with the if statement)

Any help?

1 Like

You art trying to find the player inside of the player. Instead of trying to find the player inside of the player you were trying to find the leaderstats and get to the cash. So, it would be like this:

if Price.Value >= game.Players.LocalPlayer:FindFirstChild("leaderstats").Cash.Value then

Also, I think you meant greater than and not less than so I fixed it for you

Im not getting that error anymore, my second problem is that my money don’t “disappear”.

Please do checks on serverside rather than on client side :).

2 Likes