Skip to content

Commit 83084b3

Browse files
committed
init
1 parent eef0e0d commit 83084b3

6 files changed

Lines changed: 807 additions & 0 deletions

File tree

client/functions.lua

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
function AddNetworkPropTarget(entity, options)
2+
exports.ox_target:addEntity(entity, options)
3+
end
4+
5+
function RandomMiniGame()
6+
local minigames = {'qte', 'circle', 'memory', 'math', 'reaction'}
7+
return minigames[math.random(1, #minigames)]
8+
end
9+
10+
function ProgressBar(label, duration, options)
11+
options = options or {}
12+
return lib.progressBar({
13+
duration = duration or 3000,
14+
label = label or 'Working...',
15+
useWhileDead = options.useWhileDead or false,
16+
canCancel = options.canCancel ~= false,
17+
disable = options.disable or {
18+
move = true,
19+
car = true,
20+
combat = true
21+
},
22+
anim = options.anim,
23+
prop = options.prop
24+
})
25+
end
26+
27+
function Notif(src, msg)
28+
TriggerEvent('ox_lib:notify', {
29+
type = 'success',
30+
title = 'Construction Robbery',
31+
description = msg,
32+
duration = 5000,
33+
position = 'top-right'
34+
})
35+
end
36+
37+
function RunMiniGame(game)
38+
local games = Config.MiniGames
39+
if not game or game == 'random' then
40+
local keys = {}
41+
for k in pairs(games) do
42+
keys[#keys + 1] = k
43+
end
44+
game = keys[math.random(#keys)]
45+
end
46+
local fn = games[game]
47+
return fn and fn() or false
48+
end

0 commit comments

Comments
 (0)