I'm trying to make a VIP lounge and there would be a door with a teleport, and if you don't have VIP you get teleported to a part which is a few studs away from the VIP door. Since I created the Game Pass myself, I own it. But whenever I touch the door I get teleported back even if I have the gamepass. Anyone know what happens with the script?ack even if I have the gamepass. Anyone know what happens with the script?
local teleport = game.Workspace.SpecialPart1
mps = game:GetService("MarketplaceService")
db = true
function onTouch(part)
local humanoid = part.Parent:FindFirstChild("Humanoid")
local player = game.Players:GetPlayerFromCharacter(part.Parent)
if db == true and humanoid ~= nil and (mps:UserOwnsGamePassAsync(player.UserId, 4897628) ~= nil) then
db = false
wait(0.24)
part.Parent:MoveTo(teleport.Position)
wait(0.5)
db = true
end
end
script.Parent.Touched:connect(onTouch)

1 comment
You didn't make a condition for if the player doesn't own the gamepass. Move the teleport code into an else statement for if the player doesn't own the gamepass.