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

GamePass Script not working?

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?

2 comments

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.

0

I put the package and a hat in a model then named it W.

1 answer

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)

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