Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

I made a kill npc for cash script but it only works if I use the classic sword? help.

Asked by 3 years ago

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) 
0
uh i think you need to make the katana put the creator tag in the npc. BulletproofVast 1033 — 3y
0
I would recommend finding the "Tag Editor" plugin and using that to verify if the tags parented to the humanoid are indeed correct to fit the specified parameters. BunnyFilms1 297 — 3y

Answer this question