So I have this Script that puts the player on a certian position and plays an animation. It also anchors the root part.
local function Init(Player:Player)
local Humanoid:Humanoid=Player.Character.Humanoid
local PlayerRoot:BasePart=Player.Character.HumanoidRootPart
Player.DevEnableMouseLock = false
task.wait(.1)
Track_Obj=Humanoid:LoadAnimation(Animation)
Track_Obj:Play()
repeat task.wait()
until Track_Obj.Length~=0
PlayerRoot.CFrame=Root.CFrame
Init_Camera:FireClient(Player,Camera)
PlayerRoot.Anchored = true
end
The problem is I have BreakJoints Disabled so it won’t trigger .Died event when the root is anchored. But I need it anchored.
Its a known bug.
Some alternatives you could try is to use moving constraints as suggested by progamers246810 or you could check for when health drops to 0
Does this happen only when you reset or does it happen when you take damage some other way?
From my observation if you reset with the above conditions health doesn’t become 0 in the server
Setting “RootPart.CFrame” directly is unwanted because it’s very buggy and the player position doesn’t replicate well on the server and client. Use “Character:PivotTo(…)”. It uses CFrame but it’s way more reliable. Example:
local Players = game:GetService("Players")
local randomPart = Instance.new("Part")
local function playerAdded(Player : Player)
-- Makes sure every part of the player has loaded
Player.CharacterAppearanceLoaded:Connect(function(Character : Model)
local Humanoid : Humanoid = Character.Humanoid
local PlayerRoot : BasePart = Character.HumanoidRootPart
PlayerRoot.Anchored = true
Character:PivotTo(CFrame.new(randomPart.Position))
Humanoid.Died:Connect(function()
print("Reached")
end)
end)
end
Players.PlayerAdded:Connect(playerAdded)
local con
con = hum:GetPropertyChangedSignal("Health"):Connect(function()
if hum.Health > 0 then return end
con:Disconnect()
print("died")
end)
I also encountered a similar issue when the humanoid died due to taking high amounts of damage, Died would not register, but I also had joint breaking disabled so it might be that instead. However, when it died from low health deductions, it would run just fine even with joints not breaking. Overall conclusion is that .Died is not reliable.