0% found this document useful (0 votes)
11 views2 pages

Roblox Chat Role Management Script

The document is a Lua script for a Roblox game that manages chat messages and user roles. It defines functions to check if a user is verified or a patrol member, and assigns tags based on their group rank, game pass ownership, and membership type. The script modifies incoming chat messages to include appropriate prefixes based on the user's status.

Uploaded by

Someone People
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views2 pages

Roblox Chat Role Management Script

The document is a Lua script for a Roblox game that manages chat messages and user roles. It defines functions to check if a user is verified or a patrol member, and assigns tags based on their group rank, game pass ownership, and membership type. The script modifies incoming chat messages to include appropriate prefixes based on the user's status.

Uploaded by

Someone People
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

local ChatService = game:GetService("TextChatService")

local PlayerService = game:GetService("Players")


local MarketService = game:GetService("MarketplaceService")

local GAMEPASS_VIP = 1511199989-- your gamepassids


local GROUP_ID = 517579167 -- your group id

local verifiedUserIds = {
1234567890, 1234567890, 1234567890, 1234567890, 1234567890, 1234567890,-- Add
verified UserIDs
}

local patrolUserIds = {
1234567890, 1234567890, 1234567890, 1234567890, 1234567890, 1234567890,
-- Add more patrol UserIDs
}

local function isUserVerified(userId)


for _, id in ipairs(verifiedUserIds) do
if id == userId then return true end
end
return false
end

local function isUserPatrol(userId)


for _, id in ipairs(patrolUserIds) do
if id == userId then return true end
end
return false
end

local function checkUserRole(player)


local rank = player:GetRankInGroup(GROUP_ID)
local roles = {
[255] = "<font color ='#ff0000'>[???]</font> ",
[254] = "<font color ='#ff0000'>[??]</font> ",
[200] = "<font color ='#55007f'>[??]</font> ",
[100] = "<font color ='#ffff00'>[?]</font> ",
[80] = "<font color ='#ffff00'>[?][RZ]</font> ",
[70] = "<font color ='#4b7bff'></font> ",
[60] = "<font color ='#ff66cc'>[??][HK]</font> ",
[50] = "<font color ='#ff66cc'>[??] [SK]</font> ",
[40] = "<font color ='#4b7bff'>[TOUR GUIDE]</font> ",
[1] = "<font color ='#55ff7f'></font> "
}
return roles[rank] or ""
end

local function ownsGamePass(player, passId)


local success, result = pcall(function()
return MarketService:UserOwnsGamePassAsync([Link], passId)
end)
return success and result
end

[Link] = function(msg)
local msgProps = [Link]("TextChatMessageProperties")
if [Link] then
local player = PlayerService:GetPlayerByUserId([Link])
if player then
local tagText = checkUserRole(player)
if ownsGamePass(player, GAMEPASS_VIP) then
tagText = "??[VIP]" .. tagText
end
if isUserVerified([Link]) then
tagText = "[? ]" .. tagText
end
if isUserPatrol([Link]) then
tagText = "[SECURITY] " .. tagText
end
if [Link] == [Link] then
tagText = tagText .. "? "
end
[Link] = tagText .. [Link]
end
end
return msgProps
end

You might also like