Hello, I’m looking to add Premium Benefits into my game, for example: when a Premium member joins they automatically get a chat tag, I’m not sure if it would work with this script:
local Players = game:GetService("Players")
local player = Players.LocalPlayer
if player.MembershipType == Enum.MembershipType.Premium then
game.Players.PlayerAdded:Connect(function(player)
local tags = {
{
TagText = "Premium",
TagColor = Color3.fromRGB(255, 255, 0)
}
}
local ChatService = require(game:GetService("ServerScriptService"):WaitForChild("ChatServiceRunner").ChatService)
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)
speaker:SetExtraData("ChatColor",Color3.fromRGB(0, 0, 255))
end
end)
end
I’ve reutilized the same script I use for a chat tag gamepass and re-adapted it into a Premium Benefits one but I’m not sure if it would actually work as I don’t have Premium. Should I change something in the script?
Thanks in advance