Hey, I'm testing a script, but when I press Z nothing is printed. I'm trying to add a delay when I press Z, but nothing will print... Please help
local repstore = game:WaitForChild("ReplicatedStorage")
local Remote = repstore:WaitForChild("IceStart")
Player = game.Players.LocalPlayer
Mouse = Player:GetMouse()
cool = true
Mouse.KeyDown:Connect(function(key)
key = key:lower()
if key == "z" then
if cool == true then return end
cool = false
print("Working")
wait(5)
cool = true
end
end)

2 comments
Use local variables, key down is deprecated use userinputservice
https://developer.roblox.com/api-reference/event/UserInputService/InputBegan