I tried to make a script which gives you $25 per part but when you touch it, it gives you $25 per second which is not what I wanted. Please help my by telling me what to edit or edit it yourself.

	points2 = game.Workspace.Table.Value
	 
	script.Parent.Shop.Part.Touched:Connect(function(hit)
	    if points2.value >= 1 then
	        if hit.Parent:FindFirstChild("Humanoid") ~= nil then
	            player = game.Players:GetPlayerFromCharacter(hit.Parent)
	            player.leaderstats.Money.Value = player.leaderstats.Money.Value + 25
	        end
	 
	        points2.Value = points2.Value - 1
	 
	end
end)

5 comments

0

What I was talking about is that is not giving all the money to you at once like if I have ten parts if i go to collect the money it takes ten seconds. But i'm not getting extra money.

0

Is this the full code?

0

Yes it is

0

Does this part stay forever in the game?

0

Yes it does