Last active
November 10, 2023 01:48
-
-
Save Sainan/25e55a5d50e683a73c2bf70693d5491a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
util.require_natives("2944b") | |
local cur_note = nil | |
util.create_tick_handler(function() | |
PAD.DISABLE_CONTROL_ACTION(0, 0, true) -- Disable INPUT_NEXT_CAMERA (V) | |
PAD.DISABLE_CONTROL_ACTION(0, 79, true) -- Disable INPUT_VEH_LOOK_BEHIND (C) | |
local note = nil | |
if util.is_key_down('Z') then -- C4 | |
note = 16 | |
elseif util.is_key_down('X') then -- D4 | |
note = 17 | |
elseif util.is_key_down('C') then -- E4 | |
note = 18 | |
elseif util.is_key_down('V') then -- F4 | |
note = 19 | |
elseif util.is_key_down('B') then -- G4 | |
note = 20 | |
elseif util.is_key_down('N') then -- A4 | |
note = 21 | |
elseif util.is_key_down('M') then -- B4 | |
note = 22 | |
elseif util.is_key_down(0xBC) then -- C5 | |
note = 23 | |
end | |
if cur_note and note ~= cur_note then | |
cur_note = nil | |
elseif note ~= nil then | |
cur_note = note | |
VEHICLE.SET_VEHICLE_MOD(entities.get_user_vehicle_as_handle(), 14, note) | |
PAD.SET_CONTROL_VALUE_NEXT_FRAME(0, 86, 1) | |
end | |
end) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Inspired by https://github.com/hexarobi/stand-lua-hornsongs