#help with making script only activate when tool is equipped
1 messages · Page 1 of 1 (latest)
check if the tools parent is the player's character
Agreed. Better and more efficient
** You are now Level 2! **
isnt working
when i click nothing happens now
like this?
local player = game.Players.LocalPlayer
local tool = script.Parent
local cilik = player:GetMouse()
local event = game:GetService("ReplicatedStorage"):WaitForChild("FireServer")
local isCooldown = false
local cooldownTime = 8 -- Cooldown time in seconds
tool.Activated:Connect(function()
if not isCooldown then
isCooldown = true
event:FireServer(cilik.Hit.Position)
task.wait(cooldownTime)
isCooldown = false
end
end)