Im trying to identify what input was pressed when i fired a server that read the press:
key.InputBegan:Connect(function(input)
if input.KeyCode ~= Enum.KeyCode.Q then
return
end
if key:IsKeyDown(Enum.KeyCode.A) or key:IsKeyDown(Enum.KeyCode.D) then
events.Dash:FireServer()
end
end)
This function fires the server when both Q and a or d is pressed
local events = game.ReplicatedStorage
events.Dash.OnServerEvent:Connect(function(player, direction)
print(direction)
end)
This script connects to the fired server, but im not sure what argument to put so that it detects what key activated the press between a or d. This script right now just outputs nil whenever i activate the dash.
if key:IsKeyDown(Enum.KeyCode.A) then
keyDown = "A"
events.Dash:FireServer(keyDown)
keyDown = ""
elseif key:IsKeyDown(Enum.KeyCode.D) then
keyDown = "D"
events.Dash:FireServer(keyDown)
keyDown = ""
end