Hi,
I am trying to respawn a player when they die to a part location, I have the server script below which does not error but when a player dies they get put on the SpawnPoint, not the part?
Does anyone know what I am doing wrong? thanks
game:GetService('Players').PlayerAdded:Connect(function(player)
player.CharacterAdded:Connect(function(character)
character:WaitForChild("Humanoid").Died:Connect(function()
print("Spawning to last SpawnPoint")
local DataManager = require(game.ServerStorage.DataManager)
local Profile = DataManager:GetData(player)
player.Character.HumanoidRootPart.Position = Profile.Data["CurrentStagePos"]
end)
end)
end)