local Dummy = script.Parent
local Humanoid = Dummy.Humanoid
local ThoseWhoDamaged = Dummy.ThoseWhoDamaged
local XPReward = Dummy.XPReward

Humanoid.Died:Connect(function()
	print("Dummy Died, giving rewards")
	for i, v in pairs(ThoseWhoDamaged:GetChildren()) do
		game.ReplicatedStorage.RewardXP:FireClient(v.Value, XPReward.Value)
	end
end)

This function is suppose to run when the humanoid dies, however, it does not. It's in a regular script in workspace. Why is this happening?

edit:

I made some changed to the script and it's magically working now, despite the fact that I changed nothing regarding where the script was located or how the function ran. Whatever though, it works now.

edit (again)

Turns out it is unreliable. It doesn't always fire when the humanoid dies.

3 comments

0

And no, the dummy is not getting deleted on death. The only thing changing is the humanoids health

0

May I ask more details about 'ThoseWhoDamaged'?

0

Its a folder in the Dummy. I use it to keep track of those who did damage