Cant Check players team, gives an error, provided in thread

local function checkprompt(plr: Player)
	if plr.Team == survivor or spec then --error is here
		rs.Remotes.DisableOnClient:FireClient(plr)
	elseif plr.Team == tagger then
		rs.Remotes.EnableOnClient:FireClient(plr)
	end
end

Help is appreciated!

Try adding a check to the player e.g.

if not plr then --you could use 'not plr:IsA("Player")'
    return
end

Replaced if statement with a for loop lol

how is this function called, i cannot see how this alone give that off

“plr” Might be nil, try printing it to check