-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathinit.lua
35 lines (29 loc) · 929 Bytes
/
init.lua
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
lib.locale()
local isServer = IsDuplicityVersion()
if not isServer then return end
-- Built UI check from https://github.com/overextended/ox_inventory/blob/main/init.lua
-- People don't listen.
local function addDeferral(err)
err = err:gsub("%^%d", "")
AddEventHandler('playerConnecting', function(_, _, deferrals)
deferrals.defer()
deferrals.done(err)
end)
end
-- People like ignoring errors for some reason
local function spamError(err)
CreateThread(function()
while true do
Wait(10000)
CreateThread(function()
error(err, 0)
end)
end
end)
addDeferral(err)
error(err, 0)
end
if not LoadResourceFile(GetCurrentResourceName(), 'web/dist/index.html') then
return spamError(
'Theres no built UI, download a release build or build it your self.\n ^3https://github.com/FelisDevelopment/fd_laptop^0')
end