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

Argument 1 missing or nil error with RemoteFunction?

Asked by 2 years ago

Hello, Im trying to write a script where when you sit in the seat part of the car model I made, you get anchored down and it fires a remote function. But when I test it, in the output it says "Argument 1 missing or nil" and Im confused because this only happens when I Invoke a remote function. Here's the script

local Seat = game.Workspace.Jeep.Seat

Seat:GetPropertyChangedSignal("Occupant"):Connect(function()
    if Seat.Occupant ~= nil then
        wait(.5)
        local Char = Seat.Occupant.Parent
        Char["HumanoidRootPart"].Anchored = true
        if Char["HumanoidRootPart"].Anchored == true then

            game.ReplicatedStorage.Drive:InvokeClient()
        end
    end
end)
0
Accept the guy's answer (irid_leas) Kingu_Criminal 205 — 2y

1 answer

Log in to vote
1
Answered by 2 years ago

InvokeClient requires the first argument to be a player. by calling InvokeClient as empty, you're not actually specifying which player the function would invoke on.

0
Tysm cloudysaturnn 2 — 2y
Ad

Answer this question