Here is Information how to do combination of keybinds.
First let’s create a local script at StarterCharacterScripts and name it however you want i’ve named it KeyCombination
after that we have to import User Input Service Using
local UserInputService = game:GetService('UserInputService')
then we need to add Input Began command using
UserInputService.InputBegan:Connect(function()
end)
UserInputService.InputEnded:Connect(function()
end)
UserInputService.InputChanged:Connect(function()
end)
after done we write our code:
local UserInputService = game:GetService('UserInputService')
local r_pressed = false
local T_pressed = false
UserInputService.InputBegan:Connect(function(key) -- call function when input began
if key.KeyCode == Enum.KeyCode.R then
r_pressed = true
elseif key.KeyCode == Enum.KeyCode.T then
T_pressed = true
if r_pressed then
print('combo')
end
end
end)
UserInputService.InputEnded:Connect(function(key) -- when ended
if key.KeyCode == Enum.KeyCode.R then
r_pressed = false
elseif key.KeyCode == Enum.KeyCode.T then
T_pressed = false
end
end)
UserInputService.InputChanged:Connect(function(key) -- call function when input changed
if key.KeyCode == Enum.KeyCode.R then
r_pressed = true
elseif key.KeyCode == Enum.KeyCode.T then
T_pressed = true
if r_pressed then
print('combo')
end
end
end)
as you can see it works (dont look at other errors its not from this script)
You can also change the keybinds or add third one just adding another elseif, adding variables and moving if (keybingname_pressed) then
one line down
give the feedback replying to this post