Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
-1

How to I make a tool that gives you a leaderstat when you click? [closed]

Asked by 6 years ago

What I am saying is when you equip the item, you click and it will add to your leaderstats.

Closed as Not Constructive by OldPalHappy

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
0
Answered by 6 years ago

Okay, make a LocalScript and put this in your tool.

local leaderstats = game.Players.LocalPlayer:WaitForChild("leaderstats") -- Put whatever you want here (whatever the name of your currency is) local cash = leaderstats:WaitForChild("Money")

local tool = script.Parent

local function onEquipped() cash.Value = cash.Value + 5 -- Put whatever number here end

tool.Equipped:connect(onEquipped)

Tell me if this works, I'm pretty sure it will.

0
The onEquipped event isn't a click.... Also use codeblocks please. And don't spoonfeed scripts liks this. H4X0MSYT 536 — 6y
0
You shouldn't answer questions that go against the guidelines of this site. OldPalHappy 1477 — 6y
Ad