VIP Imagebutton do Not work

I’m currently working on a game and need a VIP Morph script for the game pass. The purchase script is already written, but I still need instructions. If the player has the game pass, an image button is visible on a frame in the screengui (the frame is called: inventory). If the player clicks on the image button, a certain bundle, certain (classic) clothing, accessory and equipment is put on (all items are from the original roblox catalog, which means they have an ID). Two messages also need to be sent (one message in the roblox chat that says: [the player] wears the VIP outfit. The second message can receive parts, which means that when the outfit is put on, a message is sent to a billboardgui that shows where to go [I’ve already created the billboardgui]). I would be happy if someone could explain this to me, thanks and have a nice day :grin:

( If i make this Post in the wrong category, please Tell me what i do wrong, i don’t know much about Post Category’s :disappointed_relieved: )

Can you show us the script you’re using?

That’s the Script to buy the VIP Gamepass:

local imageButton = script.Parent
local player = game.Players.LocalPlayer

local gamePassID = 1234567 – Ersetzen Sie dies durch die tatsächliche ID Ihres Game Passes

local function onButtonClick()

local hasPass = false
local success, result = pcall(function()
    return game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId, gamePassID)
end)

if success then
    hasPass = result
else
    warn("Fehler beim Überprüfen des Game Pass-Besitzes")
end

if hasPass then
    print("Spieler besitzt den Game Pass bereits.")
else
    game:GetService("MarketplaceService"):PromptGamePassPurchase(player, gamePassID)
end

end

imageButton.MouseButton1Click:Connect(onButtonClick)

And this is the Script to make the Image Button visible

local Id = 123456789

game.Players.PlayerAdded:Connect(function(Player)
local OwnPass = Player:HasPass(Id)
if OwnPass then
– Make the ImageLabel visible by doing Player.PlayerGui
end
end)

You might want to set those instructions on the code that detects if you have the pass on buttonclick

1 Like

Ok i will try it later, thankyou :smiley:

1 Like

So you mean anything Like this ?

local player = game.Players.LocalPlayer

local gamePassID = 1234567 – Ersetzen Sie dies durch die tatsächliche ID Ihres Game Passes

local function onButtonClick()


local hasPass = false
local success, result = pcall(function()
    return game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId, gamePassID)
end)

if success then
    hasPass = result
else
    warn("Fehler beim Überprüfen des Game Pass-Besitzes")
end

if hasPass then
    print("Spieler besitzt den Game Pass bereits.")
else
    game:GetService("MarketplaceService"):PromptGamePassPurchase(player, gamePassID)
end


end

imageButton.MouseButton1Click:Connect(onButtonClick)

local Id = 123456789

game.Players.PlayerAdded:Connect(function(Player)
local OwnPass = Player:HasPass(Id)
if OwnPass then
– Make the ImageLabel visible by doing Player.PlayerGui
end
end) ```

Aighty, srry for the extremely late reply but Im here to help you out in case you haven’t figured it out yet.

local hasPass = false
local success, result = pcall(function()
    return game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId, gamePassID)
end)

if success then
    hasPass = result
else
    warn("Fehler beim Überprüfen des Game Pass-Besitzes")
end

if hasPass then
    print("Spieler besitzt den Game Pass bereits.")
local Id = 123456789
– Make the ImageLabel visible by doing Player.PlayerGui

else
    game:GetService("MarketplaceService"):PromptGamePassPurchase(player, gamePassID)
end

Thank you very much for the script, ist the rest of the script (that i post Up there with the: so you mean anything like this ) right ?

It should be, yeah, let me know if anything goes wrong

1 Like