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

GamePass Script not working?

Asked by 10 years ago
local gpid = 163264268

game.Players.PlayerAdded:connect(function(player)
    if game:GetService("GamePassService"):PlayerHasPass(player, gpid) then
        player.Teams.KorbloxTeam=true
        wait(1)
        game.Lighting.W:Clone()
        game.Lighting.W:Clone().Parent=player
    end
end)

It's suppose to be, when you buy the gamepass, you become a character. It doesn't work. Why?

0
When you buy the gamepass you become a charcter? What do you mean? You have nothing there that would change A character's looks. Perci1 4988 — 10y
0
I put the package and a hat in a model then named it W. Roboy5857 20 — 10y

1 answer

Log in to vote
-1
Answered by 10 years ago

Try using "MarketplaceService" instead, and make a function to run a receipt and tell ROBLOX they purchased the item.

it would be something like this:

local gpid = 163264268
local mps = game.MarketplaceService --you don't have to use :GetService(). I find this easier.

game.Players.PlayerAdded:connect(function(plr)
    if mps:PlayerOwnsAsset(plr,gpid) then
        player.Teams.KorbloxTeam=true   
        wait(1)
        game.Lighting.W:Clone().Parent = plr
    end
end)
Ad

Answer this question