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

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

Asked by 8 years ago

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

Log in to vote
0
Answered by 8 years ago
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.

Ad

Answer this question