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