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

Gamepass not for sale and isnt owned issue?

I posted a question yesterday,about a game pass issues that was resolved but a another issue has arisen.

this script

Gamepassid = 5654588



function Click(mouse)
player = game.Players.LocalPlayer.Name
player2 = game.Players.LocalPlayer
if game:GetService("GamePassService"):PlayerHasPass(player2, Gamepassid)then
	character = player.Character
	stage = tostring(player.Leaderstats.Steps.Value)
	stagepart = game.Workspace.Steps:FindFirstChild(stage)
	stagepos = stagepart.CFrame
	
	if game.Workspace.Steps:FindFirstChild(stage)== nil then
		msg = Instance.new("Hint")
		msg.Text = "Step still Loading Please try again in a few seconds" 
		
		else
		character.HumonoidRootPart.CFrame.Value = stagepos + CFrame.new(0,3,0)
	end
	
else
game:GetService("MarketplaceService"):PromptPurchase(player2,Gamepassid)


end
end


script.Parent.MouseButton1Down:connect(Click)

Gave the following

  • GamePassId '5654588' is not of type Game Pass. Please use MarketplaceService:PlayerOwnsAsset instead.

5654588 is a game pass seen here

I followed the recommend edit form the output

Gamepassid = 5654588



function Click(mouse)
player = game.Players.LocalPlayer.Name
player2 = game.Players.LocalPlayer
if game:GetService("MarketplaceService"):PlayerOwnsAsset(player2, Gamepassid)then
	character = player.Character
	stage = tostring(player.Leaderstats.Steps.Value)
	stagepart = game.Workspace.Steps:FindFirstChild(stage)
	stagepos = stagepart.CFrame
	
	if game.Workspace.Steps:FindFirstChild(stage)== nil then
		msg = Instance.new("Hint")
		msg.Text = "Step still Loading Please try again in a few seconds" 
		
		else
		character.HumonoidRootPart.CFrame.Value = stagepos + CFrame.new(0,3,0)
	end
	
else
game:GetService("MarketplaceService"):PromptPurchase(player2,Gamepassid)


end
end


script.Parent.MouseButton1Down:connect(Click)

this just says item isn't for sale but the item is for sale.. also i own the item as its my item so it shouldn't even show the buy item dialog.

whats going wrong?

1 comment

0

Please read my answer. (if it works accept it)

1 answer

✓ Accepted answer

Ok, you're script EDITED THIS IS EDITED ITS JUST HARD TO SEE!

Gamepassid = 5654588



function Click(mouse)
player = game.Players.LocalPlayer.Name
player2 = game.Players.LocalPlayer
if MarketplaceService:UserOwnsGamePassAsync(player.UserId, gamepassId) then --it is no longer PlayerOwnsAsset 
    character = player.Character
    stage = tostring(player.Leaderstats.Steps.Value)
    stagepart = game.Workspace.Steps:FindFirstChild(stage)
    stagepos = stagepart.CFrame

    if game.Workspace.Steps:FindFirstChild(stage)== nil then
        msg = Instance.new("Hint")
        msg.Text = "Step still Loading Please try again in a few seconds" 

        else
        character.HumonoidRootPart.CFrame.Value = stagepos + CFrame.new(0,3,0)
    end

else
game:GetService("MarketplaceService"):PromptGamePassPurchase(player2,Gamepassid) --it is no longer PromptPurchase


end
end


script.Parent.MouseButton1Down:Connect(Click)


ROBLOX Changed how it works, instead of being in library it is now it's own separate thing.

You are trying to sell this

P.S. You can't sell a place. (unless it's paid access)

Hope this helped!

8 comments

0

OOF wait

0

OK, fixed.

0

He is correct. If you want you should probably sell a gamepass to access a place, or sell access to a game, but you can't just sell a place.

0

Yeh also CAN HE ACCEPT IT??!?!

0

Hint is deprecated. you can use TextLabel with GUI's. and :connect is deprecated. use :Connect

0

Thanks, I have fixed the problem.

0

sorry about taking so long in replying im not trying to sell the place you linked im trying to sell the game pass

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