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

[Answer now!!] A very important message? PLEASE CLICK

I used so long time on this pls help

local MarketPlaceService = game:GetService("MarketplaceService")
local Players = game:GetService("Players")

local PromptSpeed = game.Workspace:WaitForChild("PromptSpeed")
local PromptBox = game.Workspace:WaitForChild("PromptPart")
local PromptPower = game.Workspace:WaitForChild("PromptJump")
local PromptVip = game.Workspace:WaitForChild("PromptVIP")

local function OnPromptPurchase(player, gamepassId)
	
	local HasPass = false
	
	local Humanoid = player.Parent:FindFirstChildOfClass("Humanoid")
	
	if (Humanoid) then
		player = game.Players:GetPlayerFromCharacter(player.Parent)
		
	HasPass = MarketPlaceService:UserOwnsGamePassAsync(player.UserId, gamepassId)	
	end
	
	if HasPass then print("Player has the gamepass already") return end
	
	if not HasPass then
		PromptSpeed.Touched:Connect(function(player)
			MarketPlaceService:PromptGamePassPurchase(player, 8638546)
			end)
				
				if not HasPass then
					PromptBox.Touched:Connect(function(player)
						MarketPlaceService:PromptGamePassPurchase(player, 8582273)
				end)
					if not HasPass then
						PromptPower.Touched:Connect(function(player)
							MarketPlaceService:PromptGamePassPurchase(player, 8796152)
					end)
						if not HasPass then
							PromptVip.Touched:Connect(function(player)
								MarketPlaceService:PromptGamePassPurchase(player, 8757181)
						end)
					end
					end
					end
					end
					end

3 comments

0

dude that looks complex

0

How is that a question? Sounds like a demand

0

Probably should edit this post to make more sense. Question? Explanation?

1 answer

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