Hello Scripters I am using a script that gives 20 money for a kill of a zombie NPC. It gives me 20 money when i kill the zombie with a sword, but when I kill it with a gun it does not give me any money. Can you guys help me modify the script so it works with a gun? Here is the script which is inside the zombie:
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.Money.Value = Leaderstats.Money.Value + 20
wait(0.1)
script:remove()
end
end
end
end
Humanoid.Died:connect(PwntX_X)

1 comment
Please format your code lololololol