Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Sold items value doesn't add to leaderstat?

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:

local interact = script.Parent

interact.Triggered:Connect(function(player)
	for i, tools in pairs(interact.Tools:GetChildren()) do
		if player.Character:FindFirstChild(tools.Name) then
			print(tools.Name)
			player.leaderstats.Money.Value += tools.Price.Value
			player.Character:FindFirstChild(tools.Name):Destroy()
		end
	end
end)

1 answer

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

2 comments

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.

0

Weird part was my answer for some reason was deleted I did not see your comment

This discussion is preserved as it was. New answers, comments, and votes are closed.