I keep getting : bad argument #2 (string expected, got nil), any help?
Asked by
4 years ago Edited 4 years ago
I keep getting this error : Players.SpoostyGuy.PlayerGui.ScreenGui.Shop.ImageButton.Script:5: bad argument #2 (string expected, got nil)
my code:
01 | script.Parent.MouseButton 1 Click:Connect( function (plr) |
02 | local playerTouch = game.Players [ plr ] |
04 | if playerTouch.leaderstats.Coins.Value > = 60 then |
06 | playerTouch.leaderstats.Coins.Value = playerTouch.leaderstats.Coins.Value - 60 |
08 | print ( "Not ENought Money!!" ) |
Also, I am using a DataStore and the leaderboard does exist
Line 5 is fine but Line 2 is the problem
Help would be appreciated