-- Basic settings

local COOLDOWN = 0.25

local tool = script.Parent

local toolPlr
local debounce = false

script.ClientActivate.OnServerEvent:connect(function(plr)
	
	-- Check if tool is equipped and correct player
	if plr == toolPlr and not debounce then
		debounce = true
		
		-- Toggle
		tool.Handle.MoneyEmitter:Emit(10)
		game.ReplicatedStorage.Interactions.Client.PlaySound:FireClient(plr, tool.Handle:FindFirstChild("Sound" .. math.random(1, 3)))
		
		-- Cooldown
		wait(COOLDOWN)
		
		debounce = false
	end
	
end)

tool.Equipped:connect(function()
	
	-- Set tool player
	toolPlr = game.Players:GetPlayerFromCharacter(tool.Parent)
	
end)
