From 700d422477005a1ab824f1d122a215339e60ea8a Mon Sep 17 00:00:00 2001 From: Andyyy7666 <86536434+Andyyy7666@users.noreply.github.com> Date: Sun, 19 Nov 2023 01:41:20 +0100 Subject: [PATCH] fix: setting vehicle props --- client/vehicle/main.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client/vehicle/main.lua b/client/vehicle/main.lua index 9c3bd56..7a44c22 100644 --- a/client/vehicle/main.lua +++ b/client/vehicle/main.lua @@ -286,7 +286,11 @@ end) AddStateBagChangeHandler("props", nil, function(bagName, key, value, reserved, replicated) local entity = GetEntityFromStateBagName(bagName) if not value or not DoesEntityExist(entity) or NetworkGetEntityOwner(entity) ~= cache.playerId then return end - lib.setVehicleProperties(entity, json.decode(value)) + local props = value + if type(value) == "string" then + props = json.decode(value) + end + lib.setVehicleProperties(entity, props) end) local function playKeyFob(veh)