Forja

Roblox VIP door script

A door that opens for people who own a game pass and offers it to everyone else: a VIP room, a private area, a shortcut for supporters.

Where it goes

  1. 1Make the pass, and copy its ID: here's how to make a game pass.
  2. 2In Roblox Studio, add an anchored Part in the doorway and name it VipDoor.
  3. 3In the Explorer, open StarterPlayer, hover over StarterPlayerScripts, press +, choose LocalScript, paste this in and put your ID in PASS_ID.
VipDoor · a LocalScript in StarterPlayerScripts
-- From forja.us/tools/roblox-scripts/vip-door-- Opens the door named VipDoor for pass owners, and offers the pass to everyone else.local MarketplaceService = game:GetService("MarketplaceService")local Players = game:GetService("Players")local PASS_ID = 0 -- your pass's idlocal player = Players.LocalPlayerlocal door = workspace:WaitForChild("VipDoor")local asked = falselocal function open()	door.CanCollide = false	door.Transparency = 0.6endlocal ok, owns = pcall(function()	return MarketplaceService:UserOwnsGamePassAsync(player.UserId, PASS_ID)end)if ok and owns then	open()endMarketplaceService.PromptGamePassPurchaseFinished:Connect(function(who, passId, bought)	if who == player and passId == PASS_ID and bought then		open()	endend)door.Touched:Connect(function(hit)	if asked or not door.CanCollide or not player.Character or not hit:IsDescendantOf(player.Character) then		return	end	asked = true	MarketplaceService:PromptGamePassPurchase(player, PASS_ID)	task.wait(5)	asked = falseend)

How it works

  • CanCollide is changed on the player's own device, so the door opens for them and stays solid for everyone else.
  • PromptGamePassPurchaseFinished opens the door straight after they buy, with no need to rejoin.
  • asked waits 5 seconds before offering again, so touching the door doesn't keep popping up the window.

Make it yours

Protect what's inside
A cheater can change things on their own device, so give out anything valuable from the server, where the game pass script checks who owns the pass.
Want something more? The script generator can write it: “A door only players with a game pass can walk through, that offers the pass to everyone else”

Maps to try it on: roleplay maps

Start from a finished map, and your scripts have a game to run in.

More free Roblox scripts