For some reason when I teleport Players HumanoidRootPart CFrame to a selected CFrame position it causes the player to die if they were teleported whilst jumping/in the air. I originally thought this was happening because of a Fall Damage script I have however I tried disabling that script and it didn’t fix anything.
Here is the code I use to teleport:
for i, Player in pairs(game.Players:GetPlayers()) do
local Character = Player.Character
if Character then
local chosenSpawnPoint = PlayAreaSpawns[math.random(1, #PlayAreaSpawns)]
local HumanoidRootPart = Character.HumanoidRootPart
HumanoidRootPart.CFrame = chosenSpawnPoint.CFrame
end
end
Could somebody please help me fix this?