I'm having trouble making a system where a player w/ a high tier VIP game pass is able to go into a room that's accessible to lower tiered VIPs.
Example: Let's say a player bought a VIP game pass that's called Mega VIP. That player who bought Mega VIP should also get access to the VIP tier below Mega VIP, called Normal VIP.
How would I let the player that bought Mega VIP also get access to Normal VIP which is a "lower tier" than Mega VIP? (Hope I didn't sound too redundant with this question.)
Here's my script: (Does not work)
local Config = script.Parent.Configuration
local Gamepass = Config.GamepassId.Value
local Group = Config.GroupId.Value
local Gamepass2 = Config.GamepassId2.Value
local Kill = Config.KillOnTouch.Value
local Door = script.Parent.Door
Door.Transparency = 0
Door.CanCollide = true
function AllowedIn(Player)
if Player.userId == 0 then
return false
elseif Gamepass or Gamepass2 > 0 then
if game.MarketplaceService:PlayerOwnsAsset(Player,Gamepass or Gamepass2) then
return true
end
elseif Group > 0 then
if Player:IsInGroup(Group) then
return true
end
end
return false
end
local Debounce = true
Door.Touched:connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local Player = game.Players:GetPlayerFromCharacter(hit.Parent)
if Player and Debounce then
Debounce = false
if AllowedIn(Player) then
Door.CanCollide = false
Door.Transparency = 0.5
spawn(function()
wait(1.5)
Door.CanCollide = true
Door.Transparency = 0
end)
else
if Gamepass or Gamepass2 > 0 then
game.MarketplaceService:PromptPurchase(Player,Gamepass)
end
if Kill then
hit.Parent.Humanoid.Health = 0
local Explosion = Instance.new("Explosion",workspace)
Explosion.BlastPressure = 0
Explosion.Position = hit.Position
else
if hit.Parent:FindFirstChild("Torso") then
hit.Parent.Torso.Velocity = Door.CFrame.lookVector * 150
end
end
end
wait(0.3)
Debounce = true
end
end
end)
