Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

Why does this Money on Kill script only work with a sword and not a gun?

Asked by 7 days ago

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) 
0
Please format your code lololololol 14zanderbilt 507 — 7d

Answer this question