Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
2

Gamepass for chat color?

Asked by 3 years ago
Edited 3 years ago

So im making a showcase thing so when you buy a gamepass you get a chat color but it is telling me that

GamePassId '14802731' is not of type Game Pass. Please use MarketplaceService:PlayerOwnsAsset instead.

When its a gamepass (Its not working with PlayerOwnsAsset)

Here is the script thanks in advanced.

local MarketPlaceService = game:GetService("MarketplaceService")
local Player = game:GetService("Players").LocalPlayer

local PremId = 14802731
local EliteId = 14802760

local settingsNorm = {  
    BubbleDuration = 15,
    MaxBubbles = 3,

    BackgroundColor3 = Color3.fromRGB(186, 250, 112),
    TextColor3 = Color3.fromRGB(57, 59, 61),
    TextSize = 16,
    Font = Enum.Font.GothamSemibold,
    Transparency = .1,
    CornerRadius = UDim.new(0, 12),
    TailVisible = true,
    Padding = 8,
    MaxWidth = 300,

    VerticalStudsOffset = 0,

    BubblesSpacing = 6,

    MinimizeDistance = 40,
    MaxDistance = 100,
}

local settingsPrem = {  
    BubbleDuration = 15,
    MaxBubbles = 3,

    BackgroundColor3 = Color3.fromRGB(250, 178, 247),
    TextColor3 = Color3.fromRGB(57, 59, 61),
    TextSize = 16,
    Font = Enum.Font.GothamSemibold,
    Transparency = .1,
    CornerRadius = UDim.new(0, 12),
    TailVisible = true,
    Padding = 8,
    MaxWidth = 300,

    VerticalStudsOffset = 0,

    BubblesSpacing = 6,

    MinimizeDistance = 40,
    MaxDistance = 100,
}

local settingsElite = { 
    BubbleDuration = 15,
    MaxBubbles = 3,

    BackgroundColor3 = Color3.fromRGB(170, 0, 0),
    TextColor3 = Color3.fromRGB(57, 59, 61),
    TextSize = 16,
    Font = Enum.Font.GothamSemibold,
    Transparency = .1,
    CornerRadius = UDim.new(0, 12),
    TailVisible = true,
    Padding = 8,
    MaxWidth = 300,

    VerticalStudsOffset = 0,

    BubblesSpacing = 6,

    MinimizeDistance = 40,
    MaxDistance = 100,
}

pcall(function()
    if game:GetService("GamePassService"):PlayerHasPass(Player, PremId) then
        game:GetService("Chat"):SetBubbleChatSettings(settingsPrem) 
    elseif game:GetService("GamePassService"):PlayerHasPass(Player, EliteId) then
        game:GetService("Chat"):SetBubbleChatSettings(settingsElite)    
    else
        game:GetService("Chat"):SetBubbleChatSettings(settingsNorm)
    end
end)
0
The Error is that it wants you to use the MarketPlace Service go here to see what it means https://developer.roblox.com/en-us/api-reference/function/MarketplaceService/UserOwnsGamePassAsync Nervousmrmonkey2 118 — 3y
0
on the PCALL Function its checking if the player has the pass Nervousmrmonkey2 118 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

Example Script;

local MarketPlaceService = game:GetService("MarketPlaceService")

local PlayerBoughtThisGamePass =  MarketPlaceService.UserOwnsGamePassAsync(Userid, GamePassIDHere)

if PlayerBoughtThisGamePass then
  print("Player Has Bought This GamePass")
end
Ad

Answer this question