Hi! I am VeloctiyDeveloper. I can build/model, but I have no clue how to script in Roblox lua. I was wondering if anyone knew how to make it so that if you buy a certain gamepass, it gives you a certain chat color. An example of what I’d think it would look like is the VIP gamepass in jailbreak, when if you buy it, you automatically get a yellow chat color.
Before posting at least try and take an attempt to create what your looking for and then we will gladly help you, Scripting Support is meant to fix problems in your code.
I can tell you what to look into thought here’s a list of them:
Like many suggested, we’re going to be using ChatService, capturing the message, and seeing if they own the gamepass.
Put this in ServerScriptService;
--//Services
local Players = game:GetService("Players")
local MarketPlaceService = game:GetService("MarketplaceService")
local ChatService = require(ServerScriptService:WaitForChild("ChatServiceRunner"):WaitForChild("ChatService"))
--//Variables
local GamePassIDs = {
VIP = 0, -- your gamepassid
}
--//Events
ChatService.SpeakerAdded:Connect(function(PlayerName)
local Speaker = ChatService:GetSpeaker(PlayerName)
local ActualPlayer = Players:FindFirstChild(PlayerName)
if MarketPlaceService:UserOwnsGamePassAsync(ActualPlayer.UserId , GamePassIDs.VIP) then
Speaker:SetExtraData("ChatColor", Color3.fromRGB(255, 255, 0)) --changes textcolor, if you need this.
Speaker:SetExtraData("Tags", {{
TagText = "VIP", --As it says, the tagtext
TagColor = Color3.fromRGB(255, 255, 0) --the tagcolor
}})
end
end)
You can do a lot more creative things with ChatTags, but this is the basics of it without going too in-depth and changing corescripts ( something you want to avoid doing as a whole )