Contoh Penggunaan 1
contoh basic, fmid_loop + ox_lib
local aktif = false
-- Contoh Loop Default
CreateThread(function()
while true do
aktif = false
if GetVehiclePedIsIn(PlayerPedId(), false) then
if IsControlJustPressed(0, 38) then
aktif = true
end
end
Wait(0)
end
end)
-- dengan fmid_loop + ox_lib
loop.create('klakson', function()
aktif = true
end)
klakson = lib.addKeybind({
name = 'klakson',
description = 'test loop',
defaultKey = 'E',
onPressed = function(self)
if cache.vehicle then
loop.start('klakson')
end
end,
onReleased = function(self)
loop.stop('klakson')
aktif = false
end
})
klakson:disable(true)
lib.onCache('vehicle', function(b)
klakson:disable(not b)
end)
Last updated