-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathonchat.lua
More file actions
24 lines (21 loc) · 981 Bytes
/
onchat.lua
File metadata and controls
24 lines (21 loc) · 981 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
-- onchat.lua
-- Implements the OnChat hook.
function OnChat(Player, Message)
if NickList[Player:GetUUID()] == nil then
PlayerName = Player:GetName()
else
PlayerName = NickList[Player:GetUUID()]
end
local Rank = cRankManager:GetPlayerRankName(Player:GetUUID())
local Message = Message
if Rank == "" or Rank == "Visitor" then
cRoot:Get():BroadcastChat(cChatColor.LightGray .. PlayerName .. cChatColor.LightGray .. ": " ..cChatColor.Plain .. Message)
elseif Rank == "Architect" then
cRoot:Get():BroadcastChat(cChatColor.Yellow .. PlayerName .. cChatColor.Yellow .. ": " ..cChatColor.Plain .. Message)
elseif Rank == "Moderator" then
cRoot:Get():BroadcastChat(cChatColor.Gold .. PlayerName .. cChatColor.Gold .. ": " ..cChatColor.Plain .. Message)
elseif Rank == "Administrator" then
cRoot:Get():BroadcastChat(cChatColor.Rose .. PlayerName .. cChatColor.Rose .. ": " ..cChatColor.Plain .. Message)
end
return true, Message
end