This fires even when the tool is unequipped and I can’t seem to figure out what went wrong.
local debounce, timeout = true, (tool:GetAttribute("Cooldown"))
local function playerClicked()
if debounce then
debounce = false
grenadeSpawnEvent:FireServer(
player.Character:FindFirstChild("Head").Position,
camera.CFrame.LookVector,
tool:GetAttribute("Magnitude"),
tool:GetAttribute("Damage"),
tool:GetAttribute("Fuse"),
tool:GetAttribute("BlastRadius"),
tool:GetAttribute("Type")
)
wait(timeout)
debounce = true
end
end
mouse.Button1Down:Connect(function()
if tool.Equipped and tool then
playerClicked()
end
end)