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

Sold items value doesn't add to leaderstat?

Asked by 2 years ago

I want to sell an Item by proximity promt, but I am having trouble every time I try to sell, it doesn't value to the leaderstat.

Script:

01local interact = script.Parent
02 
03interact.Triggered:Connect(function(player)
04    for i, tools in pairs(interact.Tools:GetChildren()) do
05        if player.Character:FindFirstChild(tools.Name) then
06            print(tools.Name)
07            player.leaderstats.Money.Value += tools.Price.Value
08            player.Character:FindFirstChild(tools.Name):Destroy()
09        end
10    end
11end)

1 answer

Log in to vote
1
Answered by 2 years ago
Edited 2 years ago

The issue maybe caused because price isn't a parent to tools Hope this helps!!

0
Not sure why you deleted your last answer then continue to post the exact same answer... Like I said on your previous answer, he already has "tools" declared on line 4. xInfinityBear 1777 — 2y
0
Weird part was my answer for some reason was deleted I did not see your comment theking66hayday 841 — 2y
Ad

Answer this question