ServerScriptService.Script:16: bad argument #2 to '?' (string expected, got table)
1 | Commands.addmoney = function (Sender, PlayerGiven, Cash) |
2 | game.Players [ PlayerGiven ] .PlayerGui.Panel.Cash.Value = game.Players [ PlayerGiven ] .PlayerGui.Panel.Cash.Value + Cash |
3 | end |
line 16 is the middle one
Ah yes I see you call Commands:addmoney() which will auto add the field self to the first paramter. Either call Commands.addmoney (without :, only .) or add self to the first paramater. Commands.addmoney(Sender, PlayerGiven, Cash) or
1 | Commands.addmoney = function (self, Sender, PlayerGiven, Cash) |
2 | game.Players [ PlayerGiven ] .PlayerGui.Panel.Cash.Value = game.Players [ PlayerGiven ] .PlayerGui.Panel.Cash.Value + Cash |
3 | end |
4 | -- Now you can call with Commands:addmoney() |
(an upvote would be appreciated)