Currently trying to make a Rust Tool Cupboard System. I haven’t mess with LUA in a while. I’m trying to add so it has a wait instead of doing the video below. I click it once and it Removes and also adds the user and vice versa. Would I go about possibly doing a Bool?
TC = script.Parent.ToolCupboard
Auth_Deauth_Detect = TC.Auth_Deauth
isLocked = script.Parent.IsLocked
isOpen = script.Parent.IsOpen
local AuthTable = { "R3DActual" }
function onAuthDeauth()
Auth_Deauth_Detect.MouseClick:Connect(function(plr)
if(table.find(AuthTable, plr.Name)) then
print("Removed from Tool Cupboard")
table.remove(AuthTable, table.find(AuthTable, plr.Name))
else
if(isLocked.Value == true) then
print("Tool Cupboard is locked")
else
print("Added to Tool Cupboard")
table.insert(AuthTable, plr.Name)
end
end
end)
end
Auth_Deauth_Detect.MouseClick:connect(onAuthDeauth)