This seems to loop for no reason
workspace.DescendantAdded:connect(function(a) if HP.CodeLock==true then wait(1) if a.ClassName=='LocalScript' or 'Script' then for Plr in pairs(game.Players:GetPlayers()) do wait(1) Tablet('Institutional white','ClassName ['..a.ClassName..']',Plr) wait(1) Tablet('Lime green','Disable ['..a.Name..']?',function() a.Disabled=true end,Plr) wait(1) Tablet('Lime green','Allow ['..a.Name..']?',function() a.Disabled=false end,Plr) end end end end)
Your check for ClassName
is incorrect.
You must be explicit in comparisons
a.ClassName=='LocalScript' or a.ClassName == 'Script'
Otherwise order of operations suggest
(a.ClassName=='LocalScript') or 'Script'
which is more or less 'Script'
(which will always act as true
)