Can't get some natives to work right


#1
local vehicle = GetVehiclePedIsIn(PlayerPedId(), false) -- Grabs the vehicle the player is in
		if GetIsVehicleStopped(vehicle) then -- checks if vehicle is stopped
	  --  while true do -- enables a loop when true
        Citizen.Wait(0) -- waits 0 ms
	SetTextComponentFormat("STRING") -- Sets Text Component Format To String
	AddTextComponentString("Press ~INPUT_THROW_GRENADE~ To Turn Off Your Engine") -- Displays the text in the notif
	DisplayHelpTextFromStringLabel(10, 20, 0, -1) -- displays it on screen!
		end -- end the function
	end -- end the function 
end) -- officially end the function!

it’s supposed to show a notification to press G when your vehicle is on and stopped but it’s not working any idea?


#2

Probably because its spamming it every frame?


#3

Isn’t it DisplayHelpTextFromStringLabel(0, 0, 1, -1) ? Rather than what you use


#4

thanks it showed the msg but now it stays on forever.


#5

Disable your loop and it should disappear after a moment


#6

that worked but now it won’t appear again when i stop.