-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclient.lua
52 lines (39 loc) · 1.27 KB
/
client.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
-- Small wait to files to load and pass variables to NUI
Wait(1000)
-- These send the game and overwrite the default values
local gameLength = 5000 -- Seconds how long the game lasts
local minSpeed = 400 -- Lower is harder
local maxSpeed = 800 -- Lower is harder
local amountToWin = 3 -- How many you have to hit to win
----------- FUNCTIONS -----------
-- Function to open the NUI display
function SetDisplay(bool)
SetNuiFocus(bool, bool)
SendNUIMessage(
{
action = "openWAM",
gameLength = gameLength,
minSpeed = minSpeed,
maxSpeed = maxSpeed,
amountToWin = amountToWin
}
)
end
----------- END FUNCTIONS -----------
----------- Debug -------------------
SetDisplay(true)
----------- End Debug ---------------
----------- NUI CALLBACKS -----------
-- Release NUI focus
RegisterNUICallback('closeWAM', function(_, cb)
SetNuiFocus(false, false)
cb('ok')
end)
-- Get result of the hack
RegisterNUICallback('gameResult', function(result, cb)
local gameResult = result.result
-- print('result is ' .. tostring(gameResult))
cb('ok')
end)
-- Wait for the NUI search callback and then trigger the server event sending playerid and search data
----------- END NUI CALLBACKS -----------