updated a lot

This commit is contained in:
Mustache Dom committed 2024-10-28 14:11:49 -07:00
1 parent 99d0ae58be
commit 70c3d9ae15
13 files changed
+358 -317

No files matched your search

+8 -1
View File
@@ -6,6 +6,13 @@ local function pick(loc)
TriggerServerEvent("shrooms:pickupCane", loc)
end
function LoadModel(hash)
RequestModel(hash)
while not HasModelLoaded(hash) do
Wait(0)
end
end
RegisterNetEvent('shrooms:respawnCane', function(loc)
local v = GlobalState.shrooms[loc]
local hash = GetHashKey(v.model)
@@ -35,7 +42,7 @@ end)
RegisterNetEvent("shrooms:init", function()
for k, v in pairs (GlobalState.shrooms) do
local hash = GetHashKey(v.model)
if not HasModelLoaded(hash) then LoadModel(hash) end
lib.requestModel(v.model, Config.RequestModelTime)
if not v.taken then
shrooms[k] = CreateObject(hash, v.location.x, v.location.y, v.location.z, false, true, true)
Freeze(shrooms[k], true, v.heading)