Skip to content

Instantly share code, notes, and snippets.

@DemmyDemon
Created July 25, 2023 21:03
Show Gist options
  • Save DemmyDemon/4ca05ab016f9693c6f44574cbfca065d to your computer and use it in GitHub Desktop.
Save DemmyDemon/4ca05ab016f9693c6f44574cbfca065d to your computer and use it in GitHub Desktop.
When you really need to frob some dumpsters
local dumpsterModels = {
218085040,
}
function Frob(dumpster)
end
function MaybeFrob(candidate)
if not DoesEntityExist(candidate) then return end
local model = GetEntityModel(candidate)
for _, dumpster in ipairs(dumpsterModels) do
if model == dumpster then
Frob(candidate)
return
end
end
end
Citizen.CreateThread(function()
while true do
Citizen.Wait(100)
local handle, obj = FindFirstObject()
MaybeFrob(obj)
local continue = true
while continue do
Citizen.Wait(0)
continue, obj = FindNextObject(handle)
MaybeFrob(obj)
end
EndFindObject(handle)
end
end)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment