Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How To Add People To A Gamepass GUI?

I made a gamepass for my groups game i woold like to add myself and my friend to our groups gamepass without needing to buy it. i already made a gamepass code i just want to add me and my friend to the list the code i use is

-- Checks For Gamepass Owned Then Makes Game.StarterGui.UI.Inventory.RadioInv Visible

 local id = 7541316
game.Players.PlayerAdded:connect(function(player)
    if local HasPass = Game:GetService("GamePassService"):PlayerHasPass(player, id) then
player:findFirstChild("StarterGui").UI.Inventory.RadioInv.Visible = true else player:findFirstChild("StarterGui").UI.Inventory.RadioInv.Visible = false
local x = Instance.new("Message",Workspace)
x.Text = player.Name .. (HasPass and " has" or " doesn't have").. " the game pass!"
wait(2)
x:Remove()
end
end)

-- Prompt

script.Parent.MouseButton1Click:connect(function()
 game:GetService("MarketplaceService"):PromptGamePassPurchase(game.Players.LocalPlayer,7541316)
end)

1 answer

✓ Accepted answer

Hello here's the script you want:

-- Checks For Gamepass Owned Then Makes Game.StarterGui.UI.Inventory.RadioInv Visible

 local id = 7541316
game.Players.PlayerAdded:connect(function(player)
    if local HasPass = Game:GetService("GamePassService"):PlayerHasPass(player, id) or player.Name == "Zetruis" then
player:findFirstChild("StarterGui").UI.Inventory.RadioInv.Visible = true else player:findFirstChild("StarterGui").UI.Inventory.RadioInv.Visible = false
local x = Instance.new("Message",Workspace)
x.Text = player.Name .. (HasPass and " has" or " doesn't have").. " the game pass!"
wait(2)
x:Remove()
end
end)

-- Prompt

script.Parent.MouseButton1Click:connect(function()
 game:GetService("MarketplaceService"):PromptGamePassPurchase(game.Players.LocalPlayer,7541316)
end)

if it worked please accept, thank you

btw jus add or player.Name == "playername" then

3 comments

1

thanks it seems to work find

1

A'ight.

1

fine*

This discussion is preserved as it was. New answers, comments, and votes are closed.