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

Argument 1 Missing or nil FireClient?

I have an issue where FireClient is returning "Argument 1 Missing or nil". I have added player to the code and it isn't working. I have come here for help on this problem. The error is at the FireClient. Here is the code:

game.ReplicatedStorage.ReturnChunk.OnServerEvent:Connect(function(plr,chunkx,chunky)
	chunk = chunksys.mapdata["chunk"..chunkx.."_"..chunky]
	if not chunk then
		game.ReplicatedStorage.ReturnChunk:FireClient(plr,chunkx,chunky,game.HttpService:JSONEncode(chunk))

1 answer

✓ Accepted answer

It means that the first argument, in your case, the player, is missing or nil. That means when you recieved the OnServerEvent, the plr did not have a value. Try checking where you sent that server event to see if you accidentally sent the wrong thing or didn't send anything at all :)

If you want, you can give us the code which fired the event so we can help you.

1 comment

0

The error wasn't occuring on argument 1 oddly. The "if not chunk then" was just me not thinking correctly and it caused the error. It is fixed now. Thanks for the help!

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