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

Can anyone help me with Kill for Cash system? [closed]

Asked by 4 years ago

I killed a NPC, my cash is 850 Next, I buy a sword in shop [Costs 650 Cash] then I kill the NPC My currency changed to 1100 (850 +250) idk why .-.

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.Exp.Value = Leaderstats.Exp.Value + 250
Leaderstats.Coins.Value = Leaderstats.Coins.Value + 250 
wait(0.1) 
script:remove() 
end 
end 
end 
end 
Humanoid.Died:connect(PwntX_X) 
0
Its likely because you never subtracted the 650 when you bought the sword. Though it's hard to tell since you haven't provided the purchasing script. climethestair 1663 — 4y
0
Nice free model. programmerHere 371 — 4y

Closed as Not Constructive by programmerHere, WideSteal321, and royaltoe

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?