local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local humanoid = char:WaitForChild("Humanoid")
local mps = game:GetService("MarketplaceService")
local gamepassID = 12178123
local gamepassOwned = false
pcall(function()
gamepassOwned = mps:UserOwnsGamePassAsync(plr.UserId, gamepassID)
end)
if gamepassOwned == true then
workspace.VIPDoor.Transparency = 0.5
workspace.VIPDoor.CanCollide = false
end
humanoid.Touched:Connect(function(touchedPart)
if gamepassOwned == true then return end
if touchedPart == workspace.VIPDoor then
mps:PromptGamePassPurchase(plr, gamepassID)
end
end)
mps.PromptGamePassPurchaseFinished:Connect(function(playerPurchased, purchasedID, purchaseSuccess)
if not purchaseSuccess then return end
if playerPurchased == plr and purchasedID == gamepassID then
gamepassOwned = true
workspace.VIPDoor.Transparency = 0.5
workspace.VIPDoor.CanCollide = false
end
end)
This vip script works when i am in a different place but in this specific place it doesnt work there is no error or anything and the in built roblox buy gamepass ui doesnt even show how can i fix this