i want to detect the currentkey that is being pressed and the previouskey that was pressed
for example if the player pressed A then D afterwards, i want to put D in currentkey variable and A in the previouskey variable
This is a very basic form of what your asking, if anyone knows how to incorporate InputChanged into this since I dont know how to use InputChanged that would be radical :
local lastKey
local currentKey
game.UserInputService.InputBegan:Connect(function(input,GPEvent)
if GPEvent then return end
currentKey = input.KeyCode
end)
game.UserInputService.InputEnded:Connect(function(input,GPEvent)
if GPEvent then return end
lastKey = input.KeyCode
end)