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

Adding numbers to leaderstats when we click on the Tool?

hello When we click on a Tool, we will increase the number of leaderstats for example:

game.workspace.Tool.activated:connect(function()

game.players.localplayer.leaderstats.Subs...???

end)

5 comments

0

Where is the question?

0

Subscribers will increase by 1 when we click

0

Ah yes, I know exactly what you are asking now.

0

Do you mean click on a Gui? Just click the mouse when the tool is selected? Explain in more depth or we can't help you.

0

I'm trying to say that when you click on a vehicle, subs will increase by 1

1 answer

This is actually a simple script that is commonly used. Do this:

local Players = game:GetService("Players")

script.Parent.Activated:Connect(function()
	local player = Players:GetPlayerFromCharacter()
	if player then
		player.leaderstats.Subscribers.Value = player.leaderstats.Subscribers.Value + 1
	end
end)

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