I need it so high level access can access low level doors.
script.Parent.Touched:Connect(function(Hit) local CheckIfCard = Hit.Parent:GetDescendants() for i,v in pairs(CheckIfCard) do if v:IsA("Tool") and v.Name == "Low Level Access" then script.Parent.CanCollide = false script.Parent.Transparency = 0.5 wait(3) script.Parent.CanCollide = true script.Parent.Transparency = 0 end end end)
I"m not sure if this will work, but try
local cards = {"Low Level Access", "Medium Level Access", etc} script.Parent.Touched:Connect(function(Hit) local CheckIfCard = Hit.Parent:GetDescendants() for i,v in pairs(CheckIfCard) do if v:IsA("Tool") and v.Name == cards then script.Parent.CanCollide = false script.Parent.Transparency = 0.5 wait(3) script.Parent.CanCollide = true script.Parent.Transparency = 0 end end end)
Create a module script and put it inside the keycard. Give it a variable level, for example:
keycardLevel = 2
and give the door a level in the main script,
doorLevel = 1
and inside the door, check if the card is equal to or higher than like so:
Variable = require(keycard.modulescriptname) if Variable.keycardLevel >= doorLevel then
and open the door or whatever you were doing.