I’m having trouble getting user input service to work correctly, and I don’t know why. I’m trying to make a flight script, and I followed a tutorial for it, but it’s not working.
local uis = game:GetService("UserInputService")
I defined user input service at the beginning.
uis.InputBegan:connect(function(input)
print("key pressed")
if input.KeyCode == Enum.KeyCode.F then
print("f pressed")
if not flying then
print("flying")
fly()
else
print("not flying")
endFlying()
end
end
end)
and I printed all the combinations, but none of them work.