@Osyris This isn’t fixed at all.
Repro.rbxl (240.8 KB)
(Press E to Enter Dead State, using LocalScript)
To briefly explain;
If you do
Hum:SetStateEnabled(Dead,false)
Hum:ChangeState(Dead)
On the Server the Humanoid won’t die, which is expected behavior.
However if you do that in the Client the Humanoid will always die.
In conclusion the Client Overrides the Humanoid’s Dead State no matter what.
(I haven’t tested with all of the other State Types, but if it happens for all of them then this is really bad)
Code
Server-Side
local PlayerS = game:GetService('Players')
local Dead = Enum.HumanoidStateType.Dead
PlayerS.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(Cha)
local Hum = Cha:WaitForChild('Humanoid')
-- Hum:SetStateEnabled(Dead,false)
-- print("Server",Hum:GetStateEnabled(Dead))
Hum:ChangeState(Dead)
Hum.Died:Connect(function()
print("Server Hum.Died")
end)
end)
end)
If you Uncomment the Commented code you’ll see that the Player will never respawn.
Client-Side
local PlayerS = game:GetService('Players')
local plr = PlayerS.LocalPlayer
local Cha = plr.Character or plr.CharacterAdded:Wait()
local Hum = Cha:WaitForChild('Humanoid')
local ContextActionS = game:GetService('ContextActionService')
local Dead = Enum.HumanoidStateType.Dead
Hum:SetStateEnabled(Dead,false)
print("Client",Hum:GetStateEnabled(Dead))
wait(1); Hum:ChangeState(Dead)
Hum.Died:Connect(function()
print("Client Hum.Died")
end)
plr.CharacterAdded:Connect(function(Cha)
Hum = Cha:WaitForChild('Humanoid')
Hum:SetStateEnabled(Dead,false)
print("Client",Hum:GetStateEnabled(Dead))
-- wait(1); Hum:ChangeState(Dead)
Hum.Died:Connect(function()
print("Client Hum.Died")
end)
end)
ContextActionS:BindAction("SetStateEnabled",function(_,State)
if State == Enum.UserInputState.Begin then
print("Client",Hum:GetStateEnabled(Dead))
Hum:ChangeState(Dead)
end
end,false,Enum.KeyCode.E)
If you Uncomment the Commented code you’ll see that the Player will respawn again and again and again.