-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathabqsb.lua
More file actions
44 lines (34 loc) · 1.43 KB
/
Copy pathabqsb.lua
File metadata and controls
44 lines (34 loc) · 1.43 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
print("(Loaded) Quantum Super Broadcast (QSB) Script - Global Warning Mode")
local Roles = { ROLE_DEVELOPER = 51 }
registerLuaCommand({
command = "qsb",
roleRequired = Roles.ROLE_DEVELOPER,
description = "Send a Quantum Super Broadcast to all players."
})
onPlayerCommandCallback(function(world, player, fullCommand)
local command, message = fullCommand:match("^(%S+)%s*(.*)")
if command ~= "asb" then return false end
if not player:hasRole(Roles.ROLE_DEVELOPER) then
player:onConsoleMessage("`4Unknown command. `oEnter /? for a list of valid commands.")
return true
end
if not message or message == "" then
player:onConsoleMessage("`oUsage: /qsb <`$message``>")
return true
end
player:onConsoleMessage("`cQuantum - Broadcast [`wFrom "..player:getName().."`c]: `^"..message)
local count = 0
for _, p in ipairs(getServerPlayers()) do
p:sendVariant({
"OnAddNotification",
"interface/science_button.rttex",
"[`c"..player:getName().."`o]\n`^"..message,
"audio/hub_open.wav",
0
})
count = count + 1
end
player:onConsoleMessage("`2Quantum message transmitted to `w"..count.."`2 players through entangled channels.")
print("[QSB] Quantum Super Broadcast by "..player:getName().." → "..count.." players: "..message)
return true
end)