i made a chat thingy but the vip or local haspass but it doesnt work because it is underlining player
local plrs = game.Players
local sss = game.ServerScriptService
local groupId = 7870490
local chatService = require(sss:WaitForChild('ChatServiceRunner'):WaitForChild('ChatService'))
chatService.SpeakerAdded:Connect(function(plr)
local speaker = chatService:GetSpeaker(plr)
local HasPass = game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserID,11925441)
if plrs[plr]:IsInGroup(groupId) and HasPass then
speaker:SetExtraData('NameColor', Color3.fromRGB(0, 255, 178))
speaker:SetExtraData('Tags', {{TagText = plrs[plr]:GetRoleInGroup(groupId), TagColor = Color3.fromRGB(0, 255, 77)}})
speaker:SetExtraData('Tags', {{TagText = 'Fan VIP', TagColor = Color3.fromRGB(0, 222, 255)}})
elseif HasPass then
speaker:SetExtraData('NameColor', Color3.fromRGB(255, 0, 0))
speaker:SetExtraData('ChatColor', Color3.fromRGB(124, 238, 255))
speaker:SetExtraData('Tags', {{TagText = 'Owner', TagColor = Color3.fromRGB(0, 222, 255)}})
elseif plrs[plr]:IsInGroup(groupId) then
speaker:SetExtraData('NameColor', Color3.fromRGB(0, 255, 178))
speaker:SetExtraData('Tags', {{TagText = plrs[plr]:GetRoleInGroup(groupId), TagColor = Color3.fromRGB(0, 255, 77)}})
speaker:SetExtraData('Tags', {{TagText = 'Fan VIP', TagColor = Color3.fromRGB(0, 222, 255)}})
end
end)
end)

1 comment
You havent set up the variable "player" beforehand. I assume you want to use your "plr" variable you already have set up.