Does roblox have some sort of anti virus built into it? Or do I have some sort of plugin that is doing this?
I am going back to a lot of my SUPER old games, back when I didn’t know how to dev, and just used a ton of free models, and in almost all of these old games, I get the below warning:
Script Workspace.Model.Model.Model.Model.Block.Fire.Spread detected as malicious. Script will not run. - Studio
Does anyone know what this is, how it works, or just any information on it at all?
The Below script is the script that got flagged as malicious
function Spread(part)
check = part:findFirstChild("Fire")
if check == nil then
script.Parent:Clone().Parent = part
elseif check ~= nil then
check.Size = check.Size + 1000000
check.Heat = check.Heat +1000000
end
end
script.Parent.Parent.Touched:connect(Spread)
function Spread(part)
check = part:findFirstChild("Fire")
if check == nil then
script.Parent:Clone().Parent = part
elseif check ~= nil then
check.Size = check.Size + 1000000
check.Heat = check.Heat +1000000
end
end
script.Parent.Parent.Touched:connect(Spread)
I mean, that is a fire-spreading script that duplicates itself onto everything it touches. It would turn your game into a lag-fest if allowed to run rampant.
I cant seem to replicate the warning in output, although that script is flawed, the script is parented to the fire, which is clones if it cannot find it, which it should unless the fire isnt called fire, creating a loop of duplicating scripts endlessly aslong as you stay touching the part
Unless Roblox’s Script Exhaust Prevention System detects this as an exhaust for the game then that wouldn’t be a solid reason why it gets flagged.
But then again, the script is not optimized at all, and any device running this would start seeing performance spikes if not heavy game lag, which Roblox could have a pre-built system for trying to prevent, however I have no idea if that is a thing or not.
local x = 100;
local y = 1000;
function SpreadFire(part: BasePart): any
check = part:FindFirstChild("Fire");
if check == nil then
local Clone_Part = script.Parent:Clone();
Clone_Part.Parent = part;
else
check.Size += math.random(x, y);
check.Heat += math.random(x, y);
end;
end;
script.Parent.Parent.Touched:Connect(Spread)
So I went into the orignal script when I posted this, cause I thought maybe roblox knows if you are the one who originally made the script or if it was inserted from a part, but when I changed the orignal script to your code, roblox stopped flagging it.
i’ve seen this in one of my old games as well, i investigated into it and all of the indentation was screwed up so i just used “format all” and it stopped being detected which leads me to believe it’s just matching a checksum with a list of known bad scripts
Run the game in studio and hover over the warning. Click on that warning and it should take you to where that warning is originating from. It could be a plugin, so I would suggest reinstalling the plugins that you have at the moment.
So, it seems to have worked? My Idea of what fixed it was either:
Lowering the numbers to not make the fire as big, saving nessecary ressources
Changed the :Clone() line to parenting on another line, this has caused me troubles when I started coding and broke scripts for me, but I have no idea why. I assume it’s the same reason as not parenting a new Instance using Instance.new directly, but Instead doing it further below, to save ressources
Usually when you get errors it states a reason behind it, and you are then able to go directly to the failing line to fix the issue. However, when scripts get marked as malicious it’s because studio is flagging it using their system code, which means it’s not an error in your code = no errors to fix, therefore it won’t let you access the code, since it’s not the one failing.
When it also clearly states that a particular single script has been flagged, it doesn’t have anything to do with plugins
I dont think it can be this, because the warning only happens when there are multiple of that script, which leads me to believe that ScriptCasual was right, that it depends on resources