-
What do you want to achieve?
I want my players to get teleported to a specific place everytime when they die/reset. -
What is the issue?
Whenever i die it tells me that i don’t have a HumanoidRootPart when my character has one -
What solutions have you tried so far?
I tried adding a :WaitForChild() but i got an infinite yield, I also tried changing it from R15 to R6, still the same errors, i got into the server and the server has the humanoidrootpart inside my character
–[[
Infinite yield possible on 'Workspace.Steven_Rafft:WaitForChild("HumanoidRootPart")'
]]–
Heres what i have in my script
game.Players.PlayerAdded:Connect(function(plr)
if game.ServerStorage.GameStarted.Value == true then
for i, v in pairs(workspace:GetChildren()) do
if v.Name == plr.Name then
v.HumanoidRootPart.CFrame = workspace.map.SpawnArea.CFrame
end
end
end
workspace:WaitForChild(plr.Name).Humanoid.Died:Connect(function()
workspace[plr.Name]:WaitForChild("HumanoidRootPart")
workspace[plr.Name].HumanoidRootPart.CFrame = workspace.map.SpawnArea.CFrame
end)
end)
This is extremely confusing since there is an humanoidrootpart in the player character, it’s like only the client has an instance of the humanoidrootpart