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) 

2 comments

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.

0

Nice free model.