I’m trying to make a holding keybind that prints “Holding H” every 0.1 seconds you hold H for but nothing’s printing
im new to UserInputService so i’m trying to figure some things out
it’s a local script in startercharacterscripts
local UIS = game:GetService("UserInputService")
local player = game.Players.LocalPlayer
local holding = false
UIS.InputBegan:Connect(function(key)
if key == Enum.KeyCode.H and holding == false then
holding = true
while holding == true do
wait(0.1)
print("Holding H")
if holding == false then
print("Stopped holding")
end
end
end
end)
UIS.InputEnded:Connect(function(key)
if key == Enum.KeyCode.H and holding == true then
holding = false
end
end)