-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathclient.lua
More file actions
81 lines (70 loc) · 2.58 KB
/
Copy pathclient.lua
File metadata and controls
81 lines (70 loc) · 2.58 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
-----------------For support, scripts, and more----------------
--------------- https://discord.gg/VGYkkAYVv2 -------------
---------------------------------------------------------------
local result = false
local NUI_Focus = false
local inGame = false
RegisterNUICallback("finalGameResult", function(data, cb)
if inGame then
result = data.finalResult == "winner"
SendNUIMessage({
action = "forceClose"
})
Wait(100)
NUI_Focus = false
else
result = false
end
cb("ok")
end)
-- triggered when player presses escape key
RegisterNUICallback("closeMenu", function(data, cb)
Wait(100)
result = false
NUI_Focus = false
end)
local function openAimGame(config)
if not config then config = {} end
local data = {
initializingTimer= config.initializingTimer or 3,
gameCountDownTime= config.gameCountDownTime or 15,
totalCorrectClicksAllowed= config.totalCorrectClicksAllowed or 3,
totalWrongClicksAllowed= config.totalWrongClicksAllowed or 2,
chooseRandomBubbleColors= config.chooseRandomBubbleColors or true,
singleBubbleColor= config.singleBubbleColor or '',
chooseRandomSizeBubbles= config.chooseRandomSizeBubbles or false,
singleBubbleSize= config.singleBubbleSize or '1'
}
NUI_Focus = true
inGame = true
SendNUIMessage({
action = "openGame",
data = data
})
SetNuiFocus(true, true)
while NUI_Focus do
Wait(20)
end
Wait(100)
SetNuiFocus(false, false)
return result
end
exports("openAimGame", openAimGame)
-- RegisterCommand("mini", function()
-- local config = {
-- initializingTimer= 2, -- in seconds
-- gameCountDownTime= 10, --in seconds
-- totalCorrectClicksAllowed= 3, -- total number of correct clicks required to win
-- totalWrongClicksAllowed= 2, -- total number of wrong click they can do before losing
-- chooseRandomBubbleColors= true, --if false singleBubbleColor will be given if provided else color from code used
-- singleBubbleColor= '', --optional - if not provided, color from code will be used
-- chooseRandomSizeBubbles= false, --if false singleBubbleSize will be given if provided else size from code used
-- singleBubbleSize= '1'--optional - if not provided, size from code will be used -> value should be integer values from 1 to 3
-- }
-- local result = exports["snipe-aimgame"]:openAimGame(config)
-- if result then
-- print("winner")
-- else
-- print("loser")
-- end
-- end)