I have this script that is 'supposed' to work, but if the player doesn't own the gamepass, they still get the gui, what's wrong?
Players = game:GetService("Players")
gps = game:GetService("GamePassService")
id = 266394204 --the gamepass id
VIP = {"Adelenia","NotSoNorm"} --special VIP players
players = game.Players:GetPlayers()
GUI = script.GUI
NewGui = nil
Player = nil
Active = false
Seat = script.Parent
script.Parent.ChildAdded:connect(function(Child)
print("1pass")
if Active == false then
print("2pass")
if Child.Name == "SeatWeld" then
print("3pass")
Active = true
Player = Players:GetPlayerFromCharacter(Child.Part1.Parent)
if Child.Parent.Parent.Parent.Name == VIP[1] or VIP[2] or VIP[3] or gps:PlayerHasPass(Player, id) then
print("4pass")
local PlayerGui = Player:FindFirstChild("PlayerGui")
if PlayerGui ~= nil then
NewGui = GUI:Clone()
NewGui.Parent = PlayerGui
else
end
end
end
end
end)
Seat.ChildRemoved:connect(function(child)
if child.Name == "SeatWeld" then
if Active == true then
Active = false
local Getchil = script.Parent.Parent.Colors:GetChildren()
for i = 1, #Getchil do
Getchil[i].BrickColor = BrickColor.new("Navy blue")
Getchil[i].Material = Enum.Material.Plastic
end
pcall(function() NewGui:Destroy() end)
Player = nil
NewGui = nil
end
end
end)

2 comments
Thanks dude
No prob. Glad I could help :P