plz help me i need help with the mod i want to have a key that will scramble the power and torque at a amount in a car so i have the keys set up but it doesn't do anything and i have a little lua code but i have no clue how to code lua so if i can get help with that that wound be great and here is the lua code thx Code: local M = {} local maxPossiblePressure local function init() electrics.values.Scramble = 0 end local function updateGFX(dt) if electrics.values.Scramble == 50 then local efficiency = 40 gui.message("Scramble", 0, "^Scramble\\.") elseif electrics.values.Scramble == 0 then gui.message("unscramble", 0, "^Scramble\\.") local efficiency = 10 end end --print(electrics.values.Scramble) -- public interface M.updateGFX = updateGFX M.onInit = init M.onReset = init return M
Unless the torque/power stuff works in a way I don't know about, it's probably not a good idea to put that logic in that function, as it runs once per graphics update and would be checking against those values constantly. If it is going to be activated by a keybind, need to make it like an event that only triggers when you call it, not every frame