It says there is an error on line 4 (Argument 1 missing or nil), I don't know what this means, thanks!
script.Parent.MouseButton1Click:Connect(function()
local name = script.Parent.Name.Text
local potatoes = script.Parent.Potatoes.Text
if game.Players:FindFirstChild(name) then
game.Players:FindFirstChild(name).leaderstats.Potatoes.Value = game.Players:FindFirstChild(name).leaderstats.Potatoes.Value + potatoes(tonumber())
end
end)

8 comments
Thanks! How would I use a remote event to pass the players name?
A RemoteEvent lets you pass various arguments, you would just pass it with any other arguments. Once more, I suggest checking out Roblox's documentation on RemoteEvents, it will give you better understanding on it!
Also it puts this error "bad argument #2 (string expected, got nil)"
on line 4, thanks!
Are you sure that you wrote any text into the field? If there's no text, it will return nil.
I see that there is something called placeholder text, is that what I should be using?
Nope, placeholder text is the text shown when you don't write anything into the field! .Text will return the text you've input. But if you haven't written anything, it returns nil!
The thing is, I write my username, but it still returns nil? I used a remote event