local clearance = {
["Card-Omni"] = true,
["Card-L5"] = true,
["Card-L4"] = true,
["Card-L3"] = true,
["Card-L2"] = false,
["Card-L1"] = false
}
and
local Debounce = false
script.Parent.Event.OnServerEvent:connect(function(Player)
local Mag = (script.Parent.Center.Position-Player.Character.HumanoidRootPart.Position).magnitude
if Mag <= script.Parent.Range.Value then
if tool.Equipped:connect() and clearance[script.Parent.Name] == true then
if not Debounce then
Debounce = true
Everything below Debounce = true is text for the script that you don't need to look at. What I do want to focus on however is
if tool.Equipped:connect() and clearance[script.Parent.Name] == true then
I know this line is incorrect in all levels but I don't know the scripting on how to make tool.Equipped:connect(), into "if a tool from clearance is equipped on player" and clearance[script.Parent.Name] == true then, into "if tool equipped has clearance that's true." I don't know anything about scripting and I'm lucky I've made it this far. The original purpose of the script which makes you stand near a door and press "e" to open and close it does works except now I'm trying to make it into a keycard door where you equip your keycard and press "e" instead. Due to the fact that the line is incorrect entirely, the door cannot work as a keycard door.

1 comment
you can shorten
if whatever == trueto justif whatever