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

Money script is only giving $25 dollars per second when touched for money?

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)

1 comment

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.

1 answer

✓ Accepted answer

If I am understanding you correctly then you want to get paid based on how many parts your character has right?

Then multiply 25 by game.Workspace.Table.Value in line 07.

player.leaderstats.Money.Value = player.leaderstats.Money.Value + 25 * game.Workspace.Table.Value

And in line 10 change the value to 0 since we're doing this all at once.

points2.Value = 0

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