I have attempted to CFrame the player to a specific position into a generated map cloned to workspace once the Countdown reaches 1 without spawning inside the floor, however it is not working for me, can anyone help with this please? I also attempted to create a forcefield around the player, it also did not work. I don't what's wrong with my script.
Server Script in ServerScriptService
local countdown = game.ReplicatedStorage.Values:WaitForChild("countdown")
for i = 15,0,-1 do
countdown.Value = i
if i == 1 then
local map = math.random(1,3)
if map == 1 then
game.ReplicatedStorage.Maps.Normal:Clone().Parent = workspace.Map
end
if map == 2 then
game.ReplicatedStorage.Maps.Red:Clone().Parent = workspace.Map
end
if map == 3 then
game.ReplicatedStorage.Maps.Green:Clone().Parent = workspace.Map
end
print(map)
for i, v in pairs(game.Players:GetPlayers()) do
local spawnLocation = workspace.Map.FindFirstChildOfClass("Model").SpawnLocation
v.Character.Torso.CFrame = spawnLocation.CFrame(spawnLocation.Position.X, spawnLocation.Position.Y + 10, spawnLocation.Position.Z)
local FF = Instance.new("ForceField")
FF.Clone()
FF.Parent = v.Character.Torso
wait(5)
FF:Destroy()
end
end
wait(1)
end

4 comments
am I missing something?
There's a property of the player Player.RespawnLocation. https://developer.roblox.com/en-us/api-reference/property/Player/RespawnLocation and with the LoadCharacter function should achieve this https://developer.roblox.com/en-us/api-reference/function/Player/LoadCharacter
I tried Player:LoadCharacter() before but thanks for help, I will try looking through this.
almost got it