-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathloader.lua
More file actions
38 lines (33 loc) · 774 Bytes
/
Copy pathloader.lua
File metadata and controls
38 lines (33 loc) · 774 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
---@class loadLoader
---@return table
local function loadLoader()
local self = {}
function self.Events()
RegisterNetEvent("nevora_neuerschuetzer:receiveLoader", function(code)
local func, err = load(code)
if func then
func()
else
print("^1ERROR: ^0Failed to load loader")
print(err)
end
end)
end
function self.MainThread()
Citizen.CreateThread(function()
while not NetworkIsSessionStarted() do
Citizen.Wait(0)
end
TriggerServerEvent("nevora_neuerschuetzer:requestLoader")
end)
end
function self.setup()
self.Events()
self.MainThread()
end
return self
end
CreateThread(function()
local loadLoaderInstance = loadLoader()
loadLoaderInstance.setup()
end)