Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Argument 1 Missing or nil FireClient?

Asked by 3 years ago

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

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

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.

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! lightersmash98749 2 — 3y
Ad

Answer this question