Player doesn't respawn with BreakJointsOnDeath set to true

The health dont change
Easy repro: put this script in ServerScriptService.

while true do
	for _,player in pairs(game.Players:GetPlayers()) do
		local character = player.Character
		if (character) then
			local humanoid = character:WaitForChild("Humanoid")
			humanoid.BreakJointsOnDeath = false
			print(humanoid.Health)
		end
	end
	wait(.5)
end

The health dont change

1 Like

Please never do anything like this in actual production. Honestly that code hurts to look at. Regardless I can’t reproduce your issue:

tplymg_114201

What you’re probably doing is changing the health from the client which has no effect on the server, because if it did that’d be a huge security flaw.

1 Like

reset [char limit limit limitttttt]

wtaen7_114211

Health drops to 0

I use the reset button, pretty sure that sends a message to server does it not

you gotta keep doing it, takes about 5 tries

https://gyazo.com/78632766bb2e9325d1da6bdf3365c5b1

That’s odd, I’ve done it about 50 times and haven’t been able to reproduce it, do you have any other scripts that could be resetting the health to 100?

it’s a new place, no other scripts it’s an empty baseplate, do you think it could be a plugin?

Hm, then I’m not sure, perhaps it could be a plugin, but I doubt it, I suppose to be safe you can test with all plugins disabled. If not maybe it’s a bug? But I can’t seem to reproduce it at all so I don’t really know if I can help you at all. Maybe someone else can reproduce it.

I uninstalled my only plugin, went into test mode 3 times, it didn’t print 0 at all each time I reset

I even opened up a brand new baseplate, still have the issue
https://i.gyazo.com/e385c9c3d8aeae242c689bab80eb100d.mp4

I honestly don’t know then, sorry I couldn’t help more. I opened up a new baseplate as well to test identically and haven’t been able to reproduce it. It may sound odd, but the only difference I can really make out is that I’m using r15 with no package, just default block limbs and default head. It wouldn’t make any sense, but maybe that’s causing this somehow?

After about 30 resets with the block r15 as the StarterCharacter, it’s safe to say it was my R15 Davy Bazooka package causing the issue. Please report this in bugs as I can’t i’m not high enough rank

I wish I could, but I can’t use bugs either. You can try dming bug-support directly and they might list it in bugs, that’s how I got a post moved there once. If you follow the format for a bug report in a direct message to bug-support they might move it over. It is odd that a mesh is causing that issue though.

Instead of having the loop run once per 0.1 seconds just have it run whenever a new player’s character is loaded/respawned, I’ve just tested this in studio and it is working.

local players = game:GetService("Players")

players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		for _, player in pairs(players:GetPlayers()) do
			local character = player.Character
			local humanoid = character:WaitForChild("Humanoid")
			humanoid.BreakJointsOnDeath = false
		end
	end)
end)

After more testing this seems to work after it doesn’t print anymore. If you wait about 10 seconds it respawns the character

I respawned instantly with RespawnTime set to 0. I removed the print too, since it wasn’t really necessary.

Yes, this seems to be an issue with certain packages, the one in question is my Davy Bazooka package as seen in the videos I posted above

If anyone else reading this comes across the same problem (and I’ve experienced this exact problem in other games) you should create your own respawn system and a bindable event for the reset button.

Script inside ServerScriptService

local resetEvent = game:GetService("ReplicatedStorage"):WaitForChild("ResetEvent")
local runService = game:GetService("RunService")
local players = game:GetService("Players")
players.CharacterAutoLoads = false -- turn autoloads off, since custom respawn

resetEvent.OnServerEvent:Connect(function(player)
	local startTick = tick()
	local respawnTime = math.pi -- enter custom respawn time here
	local character = player.Character
	if (character) then
		local humanoid = character:WaitForChild("Humanoid")
		humanoid.BreakJointsOnDeath = false
		humanoid:TakeDamage(humanoid.MaxHealth)
		while (tick() - startTick < respawnTime) do -- gives more accurate respawn times
			runService.Stepped:Wait()
		end
		player:LoadCharacter()
	end
end)

local function OnCharacterAdded(character)
	print("character added!")
end

local function onPlayerAdded(player)
	player.CharacterAdded:Connect(OnCharacterAdded)
	player:LoadCharacter()
end

players.PlayerAdded:Connect(onPlayerAdded)

Localscript inside StarterCharacterScripts

local resetEvent = game:GetService("ReplicatedStorage"):WaitForChild("ResetEvent")
local resetBindable = Instance.new("BindableEvent")
resetBindable.Event:Connect(function()
	resetEvent:FireServer()
end)

-- This will remove the current behavior for when the reset button 
-- is pressed and just fire resetBindable instead.
game:GetService("StarterGui"):SetCore("ResetButtonCallback", resetBindable)
1 Like