Hello everyone, very simple question here. I wrote a simple ragdoll script that kills the player and doesn't make them respawn until they press F. (It uses a RemoteEvent ). The script respawns the player and is supposed to make them respawn where they died, but that's where it doesn't work. It makes the player respawn, but doesn't teleport them to where they "died" or ragdolled. The code I'm using is extremely simple, here it is:
game.ReplicatedStorage.Respawn.OnServerEvent:Connect(function(Player)
local char = Player.Character
local h = Player.Character.Humanoid
local spawnpos = char.LowerTorso.Position
print("Respawning the player")
Player:LoadCharacter()
wait(1)
char.HumanoidRootPart.CFrame = spawnpos
end)
If anyone could help me out, that'd be great! Thanks in advance.

5 comments
Did you disabled the normal character load?
Yes I did. However, when I tried that, it made the character not load in when they first spawned.
You should have a script that disables the normal character load after the character is first added
Try adding a loop and check wether the characters health ~= 0 it should work.
I added a script that disables the CharacterAutoLoads. It still doesn't work. Any further suggestions?