Im making a hide 'n' seek game and i keep getting this error. Here is the line of code causing the error.
local function teleportPlayers(availablePlayers,spawns)
for _, plr in pairs (availablePlayers) do
if plr.Character then
if plr.Character:FindFirstChild("HumanoidRootPart")
plr.Character.HumanoidRootPart.CFrame = spawns[math.random(1, #spawns)].CFrame + Vector3.new(0,5,0)
end
end
end
end

1 comment
thats only part of the code btw