will this pass work wean it is finshed because i dont know how to add it to the script for the ristricted door i want this door to work with a pass will this work or is there an eaiser way to do this
local door = script.Parent
function open() -- This function will open the door. door.CanCollide = false -- Make players able to walk through the door.
for transparency = 0, 1, .1 do
door.Transparency = transparency
wait(.1)
end
end
function close() -- This function will close the door. for transparency = 1, 0, -.1 do door.Transparency = transparency wait(.1) end
door.CanCollide = true -- Make players unable to walk through the door.
end
-- This function returns the player a certain part belongs to. function get_player(part) --iterate over each player for _, player in ipairs(game.Players:GetPlayers()) do --if the part is within the player's character if part:IsDescendantOf(player.Character) then --return the player return player end end end
door.Touched:connect(function(part) -- If it isn't a character that touched the door, then we ignore it. local player = get_player(part) if not player then return end
local allow = (
player.Name == "XlaonX" or
player.Name == "upbeatxxninjaxx" or
player.Name == "charlesannals" or
player.Name == "" or
player:HasPass(213801608) or **Will this part on this line work for the vip pass**
game.CreatorId == player.userId
)
if allow then
open()
delay(4, close)
end
end)
