How to make a gamepass that gives a dark bubble chat to the player who owns it?

Hello, so basically i’m making a game where you can buy gamepass which gives you dark bubble chat, but I have some issues on it, and I don’t have any error on the output. I looked everywhere how to create this gamepass (DevForum, Developer Hub, Youtube…) but I can’t find the solution anywhere.

here’s the script I used:

local MarketplaceService = game:GetService("MarketplaceService")
local gamepassId = 40435166

local settings = {
	BubbleDuration = script.Info.BubbleDuration.Value,
	MaxBubbles = script.Info.MaxBubbles.Value,
	BackgroundColor3 = script.Info.BackgroundColor3.Value,
	TextColor3 = script.Info.TextColor3.Value,
	TextSize = script.Info.TextSize.Value,
	Font = Enum.Font[script.Info.Font.Value],
	Transparency = script.Info.Transparency.Value,
	CornerRadius = UDim.new(0, script.Info.CornerRadius.Value),
	TailVisible = script.Info.TailVisible.Value,
	Padding = script.Info.Padding.Value,
	MaxWidth = script.Info.MaxWidth.Value,
	VerticalStudsOffset = script.Info.VerticalStudsOffset.Value,
	BubblesSpacing = script.Info.BubblesSpacing.Value,
	MinimizeDistance = script.Info.MinimizeDistance.Value,
	MaxDistance = script.Info.MaxDistance.Value,
}


game.Players.PlayerAdded:Connect(function(player)
	if (MarketplaceService:UserOwnsGamePassAsync(player.UserId, gamepassId)) then
		pcall(function()
			game:GetService("Chat"):SetBubbleChatSettings(settings)
		end)
	end
end)

I put this script into ReplicatedFirst and i used the plugin Bubble Chat Customizer by @0Techy.

This is what i used for the script :

ReplicatedFirst

And i can’t make it works, so if someone knows how to make it works, it’ll help me a lot!

Thanks for using my plugin, I appreciate it.

After some workarounds, I have been able to script a gamepass only bubble chat although I’m not sure if it will work with multiple people in a game, but it should. Just replace the script that my plugin added with this one!

The script below will apply dark bubble chat for gamepass owners, and those who dont own will have the bubble chat you customized using my plugin.

--===============--
--// Techyfied / 0Techy \\--
-- This script was automatically created by Bubble Chat Customizer Plugin --
-- This script customized bubble chat depending on the settings you have created on the plugin --
--===============--

local MPS = game:GetService("MarketplaceService")
local GamepassID = 40435166
local GamepassSettings = {}


local GamepassOwnerChatSettings = {
	BubbleDuration = script.Info.BubbleDuration.Value,
	MaxBubbles = script.Info.MaxBubbles.Value,
	BackgroundColor3 = Color3.fromRGB(45, 52, 54),
	TextColor3 = Color3.fromRGB(255, 255, 255),
	TextSize = script.Info.TextSize.Value,
	Font = Enum.Font[script.Info.Font.Value],
	Transparency = script.Info.Transparency.Value,
	CornerRadius = UDim.new(0, script.Info.CornerRadius.Value),
	TailVisible = script.Info.TailVisible.Value,
	Padding = script.Info.Padding.Value,
	MaxWidth = script.Info.MaxWidth.Value,
	VerticalStudsOffset = script.Info.VerticalStudsOffset.Value,
	BubblesSpacing = script.Info.BubblesSpacing.Value,
	MinimizeDistance = script.Info.MinimizeDistance.Value,
	MaxDistance = script.Info.MaxDistance.Value,
}

local settings = {
	BubbleDuration = script.Info.BubbleDuration.Value,
	MaxBubbles = script.Info.MaxBubbles.Value,
	BackgroundColor3 = script.Info.BackgroundColor3.Value,
	TextColor3 = script.Info.TextColor3.Value,
	TextSize = script.Info.TextSize.Value,
	Font = Enum.Font[script.Info.Font.Value],
	Transparency = script.Info.Transparency.Value,
	CornerRadius = UDim.new(0, script.Info.CornerRadius.Value),
	TailVisible = script.Info.TailVisible.Value,
	Padding = script.Info.Padding.Value,
	MaxWidth = script.Info.MaxWidth.Value,
	VerticalStudsOffset = script.Info.VerticalStudsOffset.Value,
	BubblesSpacing = script.Info.BubblesSpacing.Value,
	MinimizeDistance = script.Info.MinimizeDistance.Value,
	MaxDistance = script.Info.MaxDistance.Value,

	UserSpecificSettings = GamepassSettings
}

local function UpdatePlayerBubbleChats()
	for i, v in pairs(game.Players:GetChildren()) do
		if MPS:UserOwnsGamePassAsync(v.UserId, GamepassID) then
			table.insert(GamepassSettings, v.UserId, GamepassOwnerChatSettings)
		end
	end
	
	game:GetService("Chat"):SetBubbleChatSettings(settings)
end


game.Players.PlayerAdded:Connect(function()
	UpdatePlayerBubbleChats()
end)


game.Players.PlayerRemoving:Connect(function()
	UpdatePlayerBubbleChats()
end)

pcall(function()
	UpdatePlayerBubbleChats()
end)

Let me know the results, thank you!


Note: If you do not want to use my plugin and use the normal script that doesn’t modify all settings, check out this post. It contains the alternative script.

4 Likes

Thank you so much, it works perfectly!

For future reference, you can refer to this post here as it contains relevant information about this topic:

1 Like

Can you help me make it if I have the gamepass everyone sees my bubble chat black? I tested with my friend and he told me he sees my bubble chat white and I see it black.

You could maybe just turn the local script to a server script. This way everyone would be able to see it.