ok so in my game i have a few npcs but when they die they are supposed to fire an event but instead nothing happens at all and in a live test they dont even break apart they just show that they have no health and continue on like no damage was done

i am fairy new to FE so excuse the bad scripting and knowledge

here is the code that fires the event (localscript inside the npc model)

script.Parent.Humanoid.Died:Connect(function(Humanoid) --i have no idea how parameters work i just know that the first parameter is always player when dealing with remote events
	game.ReplicatedStorage.Enemys.FETester.RemoteEvent:FireServer() --used to have Humanoid as parameter but it wasnt working so i put nothing there
end)

then the OnServerEvent script that i moved to workspace

game.ReplicatedStorage.Enemys.FETester.RemoteEvent.OnServerEvent:Connect(function(player, Humanoid) -- i put Humanoid here because like i said it was my old parameter
print("Death")
end)

2 comments

0

You do not need to use remote events for this. All damage should be applied server side so the server can handle the died event.

0

I did have it before without firing events but it only worked in studio