-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbb_s.lua
37 lines (33 loc) · 1.2 KB
/
bb_s.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
RegisterCommand('dice', function(source, args, rawCommand)
if source == 0 or source == "Console" then return end
local dices, c = tonumber(args[1]), 1
if dices then
if dices > 3 then
TriggerClientEvent('notification', source, 'You can choose a number between 1 and 3 only', 2)
return
end
local dice = {}
while c <= dices do
table.insert( dice, { dicenum = math.random(1, 6)})
c = c + 1
end
TriggerClientEvent('bb-dices:ToggleDiceAnim', source)
Citizen.Wait(2000)
TriggerClientEvent('bb-dices:ToggleDisplay', -1, source, dice, "dices")
end
end, false)
RegisterCommand('rps', function(source, args, rawCommand)
if source == 0 or source == "Console" then return end
TriggerClientEvent('bb-dices:ToggleDiceAnim', source)
Citizen.Wait(2000)
anim = tonumber(args[1])
if not anim then
TriggerClientEvent('bb-dices:ToggleDisplay', -1, source, math.random(1, 3), "rps")
elseif anim == 1 then
TriggerClientEvent('bb-dices:ToggleDisplay', -1, source,1, "rps")
elseif anim == 2 then
TriggerClientEvent('bb-dices:ToggleDisplay', -1, source, 3, "rps")
elseif anim == 3 then
TriggerClientEvent('bb-dices:ToggleDisplay', -1, source, 2, "rps")
end
end, false)