local UIS = game:GetService("UserInputService")
local function keyCombo(key, GPE)
local keysPressed = UIS:GetKeysPressed()
local space, shift = false, false
for _, key in ipairs(keysPressed) do
if (key.KeyCode == Enum.KeyCode.Space) then
space = true
elseif (key.KeyCode == Enum.KeyCode.LeftShift) then
shift = true
end
end
if space and shift then
-- Do Something
end
end
UIS.InputBegan:Connect(keyCombo)
if InputKey == Enum.KeyCode.LeftControl and InputKey == Enum.KeyCode.L then
Sender:
The Client
local function KeyComboForLightning()
local KeysPressed = UIS:GetKeysPressed()
local CTRL, L = false, false
for _, Keys in pairs(KeysPressed) do
if Keys.KeyCode == Enum.KeyCode.LeftControl then
CTRL = true
elseif Keys.KeyCode == Enum.KeyCode.L then
L = true
end
end
if CTRL and L then
SKILLS_EVENT:FireServer(KeysPressed, Mouse.Hit.Position)
end
end
SKILLS_EVENT.OnServerEvent:Connect(function(Player, InputKey, MousePos)
if Player then
-- if statements for input key
if InputKey == Enum.KeyCode.T then
if Player.Character.LeftUpperArm.Transparency == 0 then
SkillsModule.Invisibility(Player, Player.Character, 1)
elseif Player.Character.LeftUpperArm.Transparency == 1 then
SkillsModule.Invisibility(Player, Player.Character, 0)
end
elseif InputKey == Enum.KeyCode.V then
SkillsModule.Teleport(Player, Player.Character, MousePos)
elseif InputKey == Enum.KeyCode.Space then
SkillsModule.Fly(Player, Player.Character)
elseif InputKey == Enum.KeyCode.L then
PlayerDebounces[Player.Name] = true
if PlayerDebounces[Player.Name] == false then
PlayerDebounces[Player.Name] = true
ElementalModule.Lightning(Player, MousePos)
wait(1)
PlayerDebounces[Player.Name] = false
end
end
end
end)
You will want to check if Left Control is down using UserInputService:IsKeyDown. By the way the server should never (in)directly handle user input, so checking for key code on the server is unnecessary.
local UserInputService = game:GetService("UserInputService")
UserInputService.InputBegan:Connect(function(input, engine_processed)
if engine_processed then
return
end
if UserInputService:IsKeyDown(Enum.KeyCode.LeftControl) then -- the key is still down while they pressed a new key
if input.KeyCode == Enum.KeyCode.K then
-- remote:FireServer()
end
end
end)
Which is what mine does. UserInputService:IsKeyDown returns true if the key code passed is currently pressed. A key press would fire InputBegan so it’s a new input, and you are checking if the key is pressed.