local ReplicatedStorage = game:GetService("ReplicatedStorage")
local KillXPGainEvent = ReplicatedStorage:WaitForChild("KillXPGain")
local Humanoid = script.Parent:WaitForChild("Humanoid")
Humanoid.Died:Connect(function()
print("Player killed a zombie!)
KillXPGainEvent:FireServer()
end)
I'm making a zombies game and I'm trying to use a localscript to to fire a server event when a zombie is killed. I have fired the event trying other methods and it works but when I kill the zombie it doesn't register, I tried getting it to print after killing the zombie to troubleshoot but it won't print.
I'm pretty new to this so forgive me if i missed something trivial.

3 comments
can you show me the server script?
Hello, please what is parent of this script, where is it placed? I think this may be the problem
The parent of the script was the Zombie but it's OK now I managed to create a workaround so my problem is solved. Thank you for trying to help anyway is there anyway I can mark this thread as solved or should I just delete it?