So its a gui local script but the cool down wont work what have i dont wrong???
local UserInputService = game:GetService("UserInputService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local punchEvent = ReplicatedStorage:WaitForChild("PunchEvent")
local button_clicked = false
local connection
connection = script.Parent.Activated:Connect(function()
button_clicked = true
connection:Disconnect()
connection = true
end)
local readz = true
local function punch(connection,readz, gameProcessed)
if connection ~= false and readz then
connection = false
punchEvent:FireServer()
readz = false
wait(0.5)
connection = true
readz = true
print("clicked!!")
end
end
script.Parent.MouseButton1Down:Connect(punch)
-----------------
