I tried creating this game-pass script that would prompt me whenever i press on it.
I think the problem has something to do when i touch it
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
Please help

8 comments
My god
Nobody is going to help if you demand for your question to be answered.
I'm sorry man. I was a douche that day. It was a problem. It's something personal i don't want to talk about : -)
@Feahren - I know that i suck at scripting. You don't need to bring me down and make me stop scripting.
It should work like that, maybe it's in the PromptVIP, etc..
Yeah, i think so. Maybe it's something to do with if not haspass. because i wrote it 4 times.
Is someone still gonna help me :( ?
reupload you're question but don't make the title feel so demanding. Make you're title like this: How to make a button that prompts gamepass purchase?. and then add you're script in the desc. I already did that method and somebody actually helped me