Tittle says it all. Here's the script i'm have trouble with:
game:GetService("UserInputService").InputBegan:connect(function(input) if input.KeyCode == Enum.KeyCode.R and input.KeyCode == Enum.KeyCode.F then print("Started") end end) game:GetService("UserInputService").InputEnded:connect(function(input) if input.KeyCode == Enum.KeyCode.R and input.KeyCode == Enum.KeyCode.F then print("Ended") end end)
Can someone explain why don't it work with 2 keycodes, but only with one?
This is the best way i can think of to do what your trying to achieve
I used a Debounce to see if Ready was true in order for the F key to work
local Ready = false game:GetService("UserInputService").InputBegan:Connect(function(Key, Chat) if Key.KeyCode == Enum.KeyCode.R and not Chat and not Ready then Ready = true print("R Began Ready = true") end end) game:GetService("UserInputService").InputBegan:Connect(function(Key, Chat) if Key.KeyCode == Enum.KeyCode.F and not Chat and Ready then print("Read is already True, F") end end) game:GetService("UserInputService").InputEnded:Connect(function(Key, Chat) if Key.KeyCode == Enum.KeyCode.R and not Chat and Ready then Ready = false print("R Ended, Ready = false") end end)