local currencyname = "stat" -- using 'local' is just good practice
local Players = game:GetService('Players') -- This is the safe way of getting a service
local Tool = script.Parent -- if you put this script inside the tool, you don't need to use game.Workspace and all that
local DonePlayers = {}
-----------------------------------------
Tool.Equipped:Connect(function() -- This will fire every time someone equips the tool
local Player = Players:GetPlayerFromCharacter(Tool.Parent) -- Since the parent of the tool will be a player's character, we can use this function to get the relevant player
if Player and not DonePlayers[Player] then -- Make sure we actually found the player
DonePlayers[Player] = true
Player.leaderstats[currencyname].Value = Player.leaderstats[currencyname].Value + 1 -- then this line you wrote will work great!
end
end)
This is the script I made so far. This script only works once I equip the tool. I want it to fire once the tool is in my inventory. Please help me write this script or give me the part I am missing and explain what it is.

1 comment
https://gyazo.com/100dce6cca3399bedca61cfafd95b5c0