local repatore = game:WaitForChild("ReplicatedStorage") local Remote = repatore:WaitForChild("iceStart") Player = game.Players.LocalPlayer Mouse = Player:GetMouse() cool = true Mouse.KeyDown:connect(function(key) key = key:lower() if key == "f" then if cool == true then return end cool = false print("Worked") wait(5) end end)
KeyDown is deprecated, you will need to use the UIS (UserInputService) instead.
local repatore = game:WaitForChild("ReplicatedStorage") local Remote = repatore:WaitForChild("iceStart") local Player = game.Players.LocalPlayer local Mouse = Player:GetMouse() local cool = true game:GetService("UserInputService").InputBegan:Connect(function(inputObject, gameProcessedEvent) if inputObject.KeyCode == Enum.KeyCode.F then if cool == false then return end cool = false print("Worked") wait(5) cool = true end end)
Also, assuming "cool" is a debounce, you will want it to function as above in the script (reversing the bool positions), since otherwise, having defined "cool" as true to begin with, the script will never run past the "return end" line.