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:
01 | local interact = script.Parent |
02 |
03 | interact.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 |
11 | end ) |
The issue maybe caused because price isn't a parent
to tools
Hope this helps!!