Im trying to make a tag system, it does work fine with using tables, however I can’t check the badge of an user because it runs on a local script for each player.
How can I solve this problem?
Module Script
local AdminList = {
OwnerId =
691242759, -- gunsgamertv,
DevList = {
2262988748, -- CrystalSniperOwO
4723935845, -- SuperStrong_player
4563988427, -- farmero123bot
3169363636, -- S0moaly
},
AdminList = {},
ModList = {
371423168, -- nest7331
},
TesterList = {
394800974, -- Charbel0719
1623563821, -- weakles_yt
},
IsVIP = function(Player)
if Player then
if Player:IsFriendsWith(691242759) then
return true
else
local success, ownsGamePass = pcall(function()
return MarketplaceService:UserOwnsGamePassAsync(Player.UserId, FrameWork.FrameWork.Gamepasses.VIP)
end)
if success and ownsGamePass then
return true
else
return false
end
end
else
warn("Error when checking IsVIP()")
return false
end
end,
IsPreAlpha = function(Player)
if BadgeService:UserHasBadgeAsync(Player.UserId, FrameWork.Badges.PreAlphaID) then
return true
else
return false
end
end,
IsAlpha = function(Player)
if BadgeService:UserHasBadgeAsync(Player.UserId, FrameWork.Badges.AlphaID) then
return true
else
return false
end
end,
}
Local Script
TextChatService.OnIncomingMessage = function(message)
if message.TextSource then
local properties = Instance.new("TextChatMessageProperties")
local textSourcePlayer = message.TextSource
local Plr = Players:GetPlayerByUserId(textSourcePlayer.UserId)
if Plr.UserId==OwnerId then
properties.PrefixText = "<font color='#ff0000'>[Owner]</font> " .. message.PrefixText
elseif table.find(DevList, textSourcePlayer.UserId) then
properties.PrefixText = "<font color='#ff0000'>[Dev]</font> " .. message.PrefixText
elseif table.find(AdminList, textSourcePlayer.UserId) then
properties.PrefixText = "<font color='#ff1100'>[Admin]</font> " .. message.PrefixText
elseif table.find(ModList, textSourcePlayer.UserId) then
properties.PrefixText = "<font color='#0000ff'>[Mod]</font> " .. message.PrefixText
elseif table.find(TesterList, textSourcePlayer.UserId) then
properties.PrefixText = "<font color='#00aaff'>[Tester]</font> " .. message.PrefixText
elseif IsVIP(Plr) then
properties.PrefixText = "<font color='#ffaa00'>[VIP]</font> " .. message.PrefixText
elseif IsPreAlpha(Plr) then
properties.PrefixText = "<font color='#ffaa00'>[Pre-Alpha]</font> " .. message.PrefixText
elseif IsAlpha(Plr) then
properties.PrefixText = "<font color='#ffaa00'>[Alpha]</font> " .. message.PrefixText
end
return properties
end
end