Argument 1 missing or nil

Hi again lol, so i keep getting Argument 1 missing or nil idk what that means.
Stack Begin
Script ‘ServerScriptService.Pads’, Line 222 - function PlayerWin
Script ‘ServerScriptService.Pads’, Line 312 - function WinpadTouched
Stack End
Line 222:

if workspace.Markers:FindFirstChild(winroom) then -- Line 222
                Player.Team = WinnerTeam
                Teleport(Player.Character, workspace.Markers:FindFirstChild(winroom))
            else
                Player.Team = WinnerTeam
                Teleport(Player.Character, workspace.Markers.WinroomSpawn)
            end
        end
    end

Line 312:

                    PlayerWin( -- Line 312
                        Player, --player lol
                        RoomRushInfo.BadgeID or 0, --rush badge
                        RoomRushInfo.ProperName or "Unknown Room Rush", --rush name
                        Color3.fromRGB(255, 0, 255), --message color
                        "Remorseless", --difficulty, used for the webhook message
                        "NICEEE" --nice level
                    )
                    RoomRushProgressRemote:FireClient(Player,"Hide")
                else -- continue to the next Room
                    PortalTouchedRemote:FireClient(Player,RoomRushInfo[CurrentRoom])
                    RoomRushProgressRemote:FireClient(Player,CurrentRoom,#RoomRushInfo)
                end
                return
            end
1 Like

Line 222 means that “winroom” is nil make sure you’ve declared a variable named “winroom” in the script which references some existing instance by its name. Try:

if workspace.Markers:FindFirstChild("winroom")

If winroom is in fact a child of “Markers”.

The second error means that the first value passed to the function “PlayerWin” which is in fact a variable named “Player” is nil (does not actually hold any value), make sure you’re correctly defining the player object in the script so that the variable “Player” is assigned some value instead of it being nil.

Also provide the rest of the script if you can.

when finding a child of an object you always have to use quote marks so it goes FindFirstChild(“winroom”) and not FindFirstChild(winroom)