I need a VIP Gamepass teleporter

Hello everyone! I got myself in quite the predicament, being not so intelligent with programming, that I need a Game pass teleporter. For example, I have a door that is set to be a Game pass room but I do not have a script for it. I was looking for a teleporter that when you walk and hit the door, your screen will fade out, then fade back in in a game pass room, or if that is too complicated then just a VIP teleporter that TP’s you in a room.

Thanks for the help.

1 Like

Hey again :slight_smile:
When the player touches the door you can use UserOwnsGamePassAsync(GamepassID) to check if the player owns the gamepass or not. If they do you can get their character and CFrame their torso to your desired location(Inside the VIP room). You can also achieve the Fade in and out with TweenService and frames.

local MS = game:GetService("MarketplaceService")
local Door = game.Workspace:WaitForChild("Door")
local gamepassID = 12345

Door.Touched:connect(function(touched)
local debounce = false
if touched.Parent:FindFirstChild("Humanoid") then
	if not debounce then
		debounce = true
		local humanoid = touched.Parent:FindFirstChild("Humanoid")
		if humanoid.Health > 0 then
			
			local plr = game.Players:GetPlayerFromCharacter(touched.Parent)
			local plrOwnsGampass = MS:UserOwnsGamePassAsync(gamepassID)
			if plrOwnsGampass then
				--Teleport Player
				debounce = false
			else
				--Maybe prompt purchase?
				debounce = false
			end
		end
	end
end

end)

Something like this would/should work.

Hey again! Thanks for the help, I’ll go try this right now! :smiley:

One change I would do is add an else in the health check and in that make debounce=false. If the humanoid ends up being dead then the debounce will stay true and function will never run again. I didn’t catch that until I was just retreading what I did. Hope it helped:)

Yep, thanks for the help! :rocket:

Please do not use this category to ask for free scripts. It’s a support category, for when you run into issues while scripting. You should try writing it yourself first next time and coming back with specific issues.

See category guidelines:

Please adhere to them in the future.

1 Like