Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

RemoteEvent is getting error 'Argument 1 missing or nil', how do I fix it?

So here is the code accessing the local script~

player.PlayerGui.ChangeMoneyGui.RemoteClient:FireClient()

and here is the code receiving the event.

local player = game.Players.LocalPlayer
script.RemoteClient.OnClientEvent:connect(function()
	player.PlayerGui.Money.Money.Text = "Money: " .. player.leaderstats.Money.Value
end)

Anytime I try to call the event I get the error "Argument 1 missing or nil". All the code seems fine so what's the issue. The first script is a script inside workspace. The second is a local script within the players GUI.

1 comment

0

You are calling FireClient but don't actually specify which client to fire thus it errors, you either need to put the player it needs to fire or you need to put FireAllClients

1 answer

✓ Accepted answer

It's because your script that is located on the server is confused on which client to send its request to.

Try this: player.PlayerGui.ChangeMoneyGui.RemoteClient:FireClient(playerName)

This discussion is preserved as it was. New answers, comments, and votes are closed.