Hello!
The way my game checks if the player is VIP (for example), is creating a value inside a folder called “Gamepasses” on the player if they own the gamepass. If they join after they have purchased the gamepass, the chat tag does work, however if they purchase the gamepass ingame, they have to rejoin in order to have their tags be added.
When the player purchases a gamepass ingame, it also does create the value inside that folder.
This is the code:
local ServerScriptService = game:GetService("ServerScriptService")
local ChatService = require(ServerScriptService:WaitForChild("ChatServiceRunner"):WaitForChild("ChatService"))
local MarketPlaceService = game:GetService("MarketplaceService")
ChatService.SpeakerAdded:Connect(function(PlrName)
local Speaker = ChatService:GetSpeaker(PlrName)
local player = Speaker:GetPlayer()
local folder = player:WaitForChild("Gamepasses")
local VIP = folder:FindFirstChild("VIP")
if VIP then
Speaker:SetExtraData("Tags", {{
TagText = "VIP",
TagColor = Color3.fromRGB(255, 255, 255)
}})
end
end)
From what I read, SpeakerAdded only runs when the player first joins.
How would I go around this, so they get their chat tag added if they purchase the gamepass ingame?