From d17ab90ac90277b41f45df059d218a0663faeb20 Mon Sep 17 00:00:00 2001 From: ElPumpo Date: Sun, 30 Dec 2018 21:00:03 +0100 Subject: [PATCH] Check IsControlJustReleased() every frame --- client/weed.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/client/weed.lua b/client/weed.lua index 2016225e..a9027344 100644 --- a/client/weed.lua +++ b/client/weed.lua @@ -19,7 +19,7 @@ end) Citizen.CreateThread(function() while true do - Citizen.Wait(10) + Citizen.Wait(0) local playerPed = PlayerPedId() local coords = GetEntityCoords(playerPed) @@ -73,10 +73,10 @@ end Citizen.CreateThread(function() while true do - Citizen.Wait(10) + Citizen.Wait(0) local playerPed = PlayerPedId() local coords = GetEntityCoords(playerPed) - local nearbyObject, nearbyID = nil, nil + local nearbyObject, nearbyID for i=1, #weedPlants, 1 do if GetDistanceBetweenCoords(coords, GetEntityCoords(weedPlants[i]), false) < 1 then @@ -117,6 +117,8 @@ Citizen.CreateThread(function() end, 'cannabis') end + else + Citizen.Wait(500) end end