-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclient.lua
More file actions
35 lines (30 loc) · 918 Bytes
/
client.lua
File metadata and controls
35 lines (30 loc) · 918 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
local isScoreboardOpen = false
RegisterKeyMapping('toggleNeveraScoreboard', 'Open Scoreboard (NeveraDev)', 'keyboard', Config.ScoreboardButton)
RegisterCommand('toggleNeveraScoreboard', function()
isScoreboardOpen = not isScoreboardOpen
if isScoreboardOpen then
TriggerServerEvent('nv_scoreboard:getPlayers')
else
SetNuiFocus(false, false)
SendNUIMessage({
action = "close"
})
end
end, false)
RegisterNetEvent('nv_scoreboard:receivePlayers')
AddEventHandler('nv_scoreboard:receivePlayers', function(data)
if isScoreboardOpen then
SetNuiFocus(true, true)
data.action = "open"
SendNUIMessage(data)
end
end)
RegisterNUICallback('close', function(data, cb)
SendNUIMessage({
action = "close",
players = players
})
isScoreboardOpen = false
SetNuiFocus(false, false)
cb('ok')
end)