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("Worked") Remote:FireServer() wait(5) cool = true end
end)
Hello your problem is very simple to fix. You just need to use UserInputService every time, cuz "Mouse.Keydown " is deprecated.
local repstore = game:GetService("ReplicatedStorage") local Remote = repstore:WaitForChild("IceStart") local UIS = game:GetService("UserInputService") cool = true UIS.InputBegan:Connect(function(input) --fires when player inputed some key if input.UserInputType == Enum.UserInputType.Keyboard then -- checks if player inputed key using keyboard if input.KeyCode == Enum.KeyCode.Z and cool == true then -- checks if key z and cool = true cool = false print("Worked!") Remote:FireServer() wait(.5) cool = true end end end)
P.S. Please put all your script in script block, not a half