I have been stumped by this problem, it continually comes up with "Argument 1 missing or nil". I know it's a simple script but I have been stuck for hours. Can anyone debug it and end my suffering please. ;-;
script.Parent.MouseButton1Click:connect(function() local directory = script.Parent.Parent local player_name = directory["Name"].Text local amount = directory["Amount"].Text game.Players:FindFirstChild(player_name)["leaderstats"]["Coins"].Value = game.Players:FindFirstChild(player_name)["leaderstats"]["Coins"].Value + tonumber(amount) end)
Basically what I've got is a GUI with a name textbox and an amount textbox, without any text in them and only placeholder text. Heres a picture:
https://gyazo.com/0ffb62c0947a033cc2f82c05af93c304
repeat wait() until game.Players.LocalPlayer local amount = script.Parent.Parent.Amount.Text game.Players.LocalPlayer.leaderstats.Coins.Value = game.Players.leaderstats.Coins.Value + tonumber(amount)