From 4655a7b07a591e2fd080bd1b1f57b6c8cbf59595 Mon Sep 17 00:00:00 2001 From: dragekk <53555592+dragekk@users.noreply.github.com> Date: Tue, 27 Jun 2023 16:04:17 +0200 Subject: [PATCH] fixes :3 --- RCcar/RCmain.lua | 20 ++++++++++++++++++-- RCcar/armsHider.lua | 2 +- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/RCcar/RCmain.lua b/RCcar/RCmain.lua index 63d32d7..5024009 100644 --- a/RCcar/RCmain.lua +++ b/RCcar/RCmain.lua @@ -117,13 +117,29 @@ Input.Start.press = function () RC.engine = not RC.engine Camera.mode = RC.engine if RC.engine then - pings.GNRCcarCtrlSteer(0) - pings.GNRCcarCtrlThrottle(0) + local steer = 0 + if Input.Left:isPressed() then + steer = steer + 1 + end + if Input.Right:isPressed() then + steer = steer - 1 + end + pings.GNRCcarCtrlSteer(steer) + local throttle = 0 + if Input.Forward:isPressed() then + throttle = throttle + 1 + end + if Input.Backward:isPressed() then + throttle = throttle - 1 + end + pings.GNRCcarCtrlThrottle(throttle) if player:isLoaded() then Camera.dir = RC.mat.c3.xz end host:setActionbar('[{"text":"Remote Controll Mode: "},{"text":"Enabled","color":"green"}]') else + pings.GNRCcarCtrlSteer(0) + pings.GNRCcarCtrlThrottle(0) host:setActionbar('[{"text":"Remote Controll Mode: "},{"text":"Disabled","color":"red"}]') end if respawn_time_check > 5 then diff --git a/RCcar/armsHider.lua b/RCcar/armsHider.lua index 52317b6..9854594 100644 --- a/RCcar/armsHider.lua +++ b/RCcar/armsHider.lua @@ -1,6 +1,6 @@ local RC = require("RCcar.RCmain") events.RENDER:register(function (delta, context) - local hide = (context ~= "FIRST_PERSON" or not RC.engine) + local hide = (context ~= "FIRST_PERSON" or not RC:getCarProperties().engine) vanilla_model.RIGHT_ARM:setVisible(hide) vanilla_model.RIGHT_ITEM:setVisible(hide) vanilla_model.RIGHT_SLEEVE:setVisible(hide)