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

How would I add it so if people own a gamepass theyre added to the 'Permited'?

Gamepass> http://www.roblox.com/Referee-READ-DESC-item?id=378400317

local Permitted = {"iSidersz", "Player", "OrlandoBaller", "Vikesboy1", "badmax2021", "piratesfan21", "k1nq", "spidermanfuri", "mjkrga", "epikpython", "HttpDomi"}
local clo = game.Workspace.Puck:clone()

 
game.Workspace.Puck:clone()
game.Players.PlayerAdded:connect(function(plr) 

    for i,v in pairs(Permitted) do

        if v:lower() == plr.Name:lower() then
            plr.Chatted:connect(function(msg)

                if msg:lower() == "arp" then
	clo:clone().Parent = game.Workspace



                    
                end

            end)

        end

    end
end)

1 answer

local Permitted = {"iSidersz", "Player", "OrlandoBaller", "Vikesboy1", "badmax2021", "piratesfan21", "k1nq", "spidermanfuri", "mjkrga", "epikpython", "HttpDomi"}
local clo = game.Workspace.Puck:clone()
local mp = game:GetService("MarketplaceService")
local GamepassId = 00000 -- Put the ID of the Gamepass here

game.Workspace.Puck:clone()
game.Players.PlayerAdded:connect(function(plr) 
	
	if mp:PlayerOwnsAsset(plr, GamepassId) then -- Check if 'plr' owns the gamepass 
		table.insert(Permitted, plr.Name) -- add their name to the Permitted table
	end
	
    for i,v in pairs(Permitted) do

        if v:lower() == plr.Name:lower() then
            plr.Chatted:connect(function(msg)

                if msg:lower() == "arp" then
    clo:clone().Parent = game.Workspace




                end

            end)

        end

    end
end)

I didn't provide a massive amount of information so if you have a question, just comment it. If this helped (and works) accept this answer.

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