function CharacterModule.Spawn()
local notTaken = CurrentRoundData.Map.Spawns:GetChildren()
for _, playerData in CurrentRoundData.PlayerData do
if playerData.Dead then continue end
local character = playerData.Character
local humanoid = character:WaitForChild(“Humanoid”)
humanoid.WalkSpeed = 0
humanoid.JumpPower = 0
local selectedSpawn = notTaken[math.random(1, #notTaken)]
table.remove(notTaken, table.find(notTaken, selectedSpawn))
if not selectedSpawn then
notTaken = CurrentRoundData.Map.Spawns:GetChildren()
selectedSpawn = notTaken[math.random(1, #notTaken)]
end
character.HumanoidRootPart.Anchored = true
wait()
character:MoveTo(selectedSpawn.Position + Vector3.new(0, 2, 0))
character.HumanoidRootPart.Anchored = false
humanoid.WalkSpeed = 16
humanoid.JumpPower = 50
end
end
the characters are sometimes falling down the map, any ideas i can prevent this because it’s been about month i still cant fix this
So from what I can see, when the game starts you teleport players to a unique spawn. I suggest just moving the CFrames of the humanoidrootpart to the spawn instead of using character:MoveTo(). See if that fixes anything.
If it’s only sometimes happening, it might be because some players haven’t downloaded the whole map onto their client.
Try adding a wait(3) before teleporting players to make sure they have 3 seconds to download the map
Teleport the player back to their spawn position if they go too far under the map
Add a section to keep teleporting the player until they no longer fall off
If you’re using streaming enabled (which I think roblox enables by default now, call :RequestStreamAroundAsync() to the map, wait 1 second, then teleport the player there and enable pausing