hello, fellow scripters!
I have an antivirus plugin and i wanted to set up a switch to turn on 24/7 security or not, so I used the plugin setting function. the only problem is, when it runs, it is supposed to not scan the item as it is on 0 (off). but for SOME bloody reason, it still runs. can somebody tell me the issue?
(i included all code for 24/7 security just in case my end was in the wrong place.) code:
if plugin:GetSetting("TFsc") == 1 then -- HERE
print(plugin:GetSetting("TFsc")) -- PRINTS NOTHING
yeetbeet = 0
wait(3)
if workspace:FindFirstChild("threats found") then
else
threats = Instance.new("Folder")
threats.Parent = workspace
threats.Name = "threats found"
end
print("scanning new item in workspace",Item.Name)
local children = Item:GetChildren()
for i = 1, #virusnames do
local virusname = virusnames[i]
if Item.Name == virusname then
print("virus found!")
yeetbeet = yeetbeet + 1
Item.Parent = workspace:FindFirstChild("threats found")
end
end
children = Item:GetChildren()
for i = 1, #children do
local child = children[i]
for i = 1, #virusnames do
local virusname = virusnames[i]
if child.Name == virusname then
print("virus found!")
yeetbeet = yeetbeet + 1
child.Parent = workspace:FindFirstChild("threats found")
end
end
local children = child:GetChildren()
for i = 1, #children do
local child = children[i]
for i = 1, #virusnames do
local virusname = virusnames[i]
if child.Name == virusname then
print("virus found!")
yeetbeet = yeetbeet + 1
child.Parent = workspace:FindFirstChild("threats found")
end
end
local children = child:GetChildren()
for i = 1, #children do
local child = children[i]
for i = 1, #virusnames do
local virusname = virusnames[i]
if child.Name == virusname then
print("virus found!")
yeetbeet = yeetbeet + 1
child.Parent = workspace:FindFirstChild("threats found")
end
end
local children = child:GetChildren()
for i = 1, #children do
local child = children[i]
for i = 1, #virusnames do
local virusname = virusnames[i]
if child.Name == virusname then
print("virus found!")
yeetbeet = yeetbeet + 1
child.Parent = workspace:FindFirstChild("threats found")
end
end
local children = child:GetChildren()
for i = 1, #children do
local child = children[i]
for i = 1, #virusnames do
local virusname = virusnames[i]
if child.Name == virusname then
print("virus found!")
yeetbeet = yeetbeet + 1
child.Parent = workspace:FindFirstChild("threats found")
end
end
local children = child:GetChildren()
for i = 1, #children do
local child = children[i]
for i = 1, #virusnames do
local virusname = virusnames[i]
if child.Name == virusname then
print("virus found!")
yeetbeet = yeetbeet + 1
child.Parent = workspace:FindFirstChild("threats found")
end
end
local children = child:GetChildren()
for i = 1, #children do
local child = children[i]
for i = 1, #virusnames do
local virusname = virusnames[i]
if child.Name == virusname then
print("virus found!")
yeetbeet = yeetbeet + 1
child.Parent = workspace:FindFirstChild("threats found")
end
end
local children = child:GetChildren()
for i = 1, #children do
local child = children[i]
for i = 1, #virusnames do
local virusname = virusnames[i]
if child.Name == virusname then
print("virus found!")
yeetbeet = yeetbeet + 1
child.Parent = workspace:FindFirstChild("threats found")
end
end
local children = child:GetChildren()
for i = 1, #children do
local child = children[i]
for i = 1, #virusnames do
local virusname = virusnames[i]
if child.Name == virusname then
print("virus found!")
yeetbeet = yeetbeet + 1
child.Parent = workspace:FindFirstChild("threats found")
end
end
local children = child:GetChildren()
for i = 1, #children do
local child = children[i]
for i = 1, #virusnames do
local virusname = virusnames[i]
if child.Name == virusname then
print("virus found!")
yeetbeet = yeetbeet + 1
child.Parent = workspace:FindFirstChild("threats found")
end
end
local children = child:GetChildren()
for i = 1, #children do
local child = children[i]
for i = 1, #virusnames do
local virusname = virusnames[i]
if child.Name == virusname then
print("virus found!")
yeetbeet = yeetbeet + 1
child.Parent = workspace:FindFirstChild("threats found")
end
end
local children = child:GetChildren()
for i = 1, #children do
local child = children[i]
for i = 1, #virusnames do
local virusname = virusnames[i]
if child.Name == virusname then
print("virus found!")
yeetbeet = yeetbeet + 1
child.Parent = workspace:FindFirstChild("threats found")
end
end
local children = child:GetChildren()
for i = 1, #children do
local child = children[i]
for i = 1, #virusnames do
local virusname = virusnames[i]
if child.Name == virusname then
print("virus found!")
yeetbeet = yeetbeet + 1
child.Parent = workspace:FindFirstChild("threats found")
end
end
end
end
end
end
end
end
end
end
end
end
end
end
end
print("scan complete!")
if yeetbeet > 0 then
print("oh noes. virus found!")
local yeetleetbett = plugin:CreateDockWidgetPluginGui(
math.random(1.1,1000000000.9),
DockWidgetPluginGuiInfo.new(
Enum.InitialDockState.Float,
true,
true,
500, 500, 500, 500
)
)
yeetleetbett.Title = "virus found"
local GUIlui = script.Parent.GUIs.VirusFound:Clone()
GUIlui.Parent = yeetleetbett
GUIlui.virustext.Text = "Some viruses were found in a inserted item! Delete them or ignore this warming?"
yeetleetbett.VirusFound.ignore.MouseButton1Click:Connect(function()
yeetleetbett:Destroy()
end)
yeetleetbett.VirusFound.deletevirus.MouseButton1Click:Connect(function()
workspace:FindFirstChild("threats found"):ClearAllChildren()
yeetleetbett:Destroy()
end)
end
end
end
