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

game pass service not working ?

Asked by 9 years ago
local player = script.Parent.Parent.Parent.Parent.Parent.Parent
local id = script.Parent.Link.Value
local List = {
a1, a2, b1, b2, c1, c2, d1, d2, e1, e2, f1, f2, g1, g2, h1
}

function GetItem(className,ID)
    if ID ~= 0 then
        Item = game:GetService("InsertService"):LoadAsset(ID):GetChildren()[1]
        if Item:IsA(className) then
            return Item
        else
            return false
        end
    else
        return 0
    end
end

function IsClass(item,className)
    if item then
        if item:IsA(className) then
            return true
        else
            return false
        end
    end
end


function list()
    if GamePassService:PlayerHasPass(player, id)  or player.Character.Name == "Players1" then
    if type(tonumber(FaceID.Text)) == "number" then
        Blarg = GetItem("Decal",tonumber(FaceID.Text))
        if IsClass(Blarg,"Decal") then
            pcall(function() C.Head:FindFirstChild("face"):remove() end)
            Blarg.Parent = C.Head
                        else
        game:GetService("MarketplaceService"):PromptPurchase(player,id) 
            end
        end
    end
end



for i = 1,#List do
    List[i].MouseButton1Up:connect(function()
list()
    end)
end


1 answer

Log in to vote
0
Answered by 9 years ago

Do you have any output? Is it doing something wrong? Explain more.

EDIT:

You can't just say GamePassService. You need to say game:GetService("GamePassService")

0
on output it just says cant access gamepassservice but when i publish and test it doesnt work at all Layfonex 0 — 9y
Ad

Answer this question