For example, if someone says something in the chat, their name will show up as "[VIP]" and then their name. I've seen a lot of games that have this feature. I just can't figure out how you add the tag to the player's name. If one of you know how to script quite well, it would be kind to help me with this.
Here's what I've tried:
game.Players.PlayerAdded:Connect(function(player) local tags = Instance.new("Folder", player) tags.Name = "Tags" if (service:UserOwnsGamePassAsync(player.UserId, gamepassId)) then local newTag = Instance.new("IntValue", tags) newTag.Name = "VIP" local chatColor = Instance.new("Color3Value", newTag) chatColor.Name = "ChatColor" chatColor.Value = BrickColor.new("Gold").Color local tagColor = Instance.new("Color3Value", newTag) tagColor.Name = "TagColor" tagColor.Value = Color3.fromRGB(239, 184, 56) end end)
Its simple, roblox already have a module script for this.
Example:
-- Server script local gamepassId = 0 -- Your gamepass id local service = game:GetService("MarketplaceService") game.Players.PlayerAdded:Connect(function(player) if (service:UserOwnsGamePassAsync(player.UserId, gamepassId)) then -- check if have gamepass local tags = { -- table for tags { -- first tag TagText = "VIP", -- Tag text TagColor = Color3.fromRGB(239, 184, 56) -- TagColor } } local ChatService = require(game:GetService("ServerScriptService"):WaitForChild("ChatServiceRunner").ChatService) -- Get chat service -- Get speaker local speaker = nil while speaker == nil do speaker = ChatService:GetSpeaker(player.Name) if speaker ~= nil then break end wait(0.01) end speaker:SetExtraData("Tags",tags) -- Set tags speaker:SetExtraData("ChatColor",Color3.fromRGB(239, 184, 56)) -- Change chat color, and dont use BrickColor.new(...).Color end end)
Wiki page for Char modules: Roblox Wiki - Chat
Hope it helped :D
?Index the PlayersMessage, then tie it to the message using
newTag..": "..ChatMessage
First of all, you said just Service
without having a variable for it.
Second of all, you didnt assign the tag to the chat system
i dont really know how to assign it to the chat system, but you can probably find it on youtube