I have this one problem that I don't know how to fix. I'm trying to make a script were you kill an npc and it gives you money. But it only works if you use a classic sword, and I want it to work with my custom katana.
Here's my local script inside of my npc that supposed to give you cash when you kill the npc:
local Humanoid = script.Parent.Humanoid function PwntX_X() local tag = Humanoid:findFirstChild("creator") if tag ~= nil then if tag.Value ~= nil then local Leaderstats = tag.Value:findFirstChild("leaderstats") if Leaderstats ~= nil then Leaderstats.Cor.Value = Leaderstats.Cor.Value + 25 wait(0.1) script:remove() end end end end Humanoid.Died:connect(PwntX_X)