How do i block modules from being run in my game?

Well you can look through all the source’s.

function scan(object)
if object:IsA("Script") then
if object.Source == --[[go on from here]] then


end
end
end

wait so like type the require() source code part.

EX:

function scan(object)
if object:IsA("Script") then
if object.Source == "require(id)" then

end
end
end

Well you can take off my attempt:

local forbiddenSoruces = {"MarketplaceService"}
function CheckSource(scriptScan)
	for i = 1, #forbiddenSoruces do
		local splitSource = scriptScan.Source:split(" ")
		if table.find(splitSource,i) then
			scriptScan:Destroy()
			if scriptScan ~= nil then
				scriptScan:Remove()
			end
			return true
		else
			return false
		end
		end
end
function scan(object)
	local insides = object:GetChildren()
	for i = 1,#insides do
		for i2, v in pairs(insides) do
			pcall(function()
			if v:IsA("Script") then
				if CheckSource(insides[i]) == true then
			return "Malware"
		else
			return "Safe"
		end
				end
			end)
		end
	end
end
print(scan(game))

So basically what your doing is if a script requires a random module then blocks it.

so would this block like HD admin and Donation board stuff tho. Or just bad require() modules.

it will block the id you put for id.

But the script has to contain ONLY that text.

So what if it was like a hidden one in a script. I just want to destroy the script if it has a virus.

if it’s a hidden script then you do this:

function scan(object)
local insides = object:GetChildren()
for i = 1,#insides do
if insides[i]:IsA("Script") or object:IsA("Script") then
if insides[i].Source = "require(badId)" then
insides[i]:Destroy()
elseif object.Source == "require(badId)" then
object:Destroy()
end
end
end
end
end

So what if it was like a hidden one in a script. I just want to destroy the script if it has a virus. Also, to where it doesn’t ban stuff like HD admin from doing require. ops devforum made me write that twice

Nuh it only bans the id you put there.

Okay, so if i wanted to ban 100+ scripts it would work?

You can’t use script.source unless it is in a plugin or the command bar.

If you constantly add

if script.Source == "jasid" or script.Source == "idsjhsdsa" or script.Souce --blah

I expect this to be a plugin, more people trust plugins than models.

I want to ban virus require() statments, not plugins.

I believe he is just making an anti-exploit script, not a plugin. Therefor, script.source is not an option to use.

Ok then we have to go to Script.Name now…

But how do i do that. You gave me like 5+ scripts.

Seeing what scripts are using require requires a higher level of robloxscriptsecurity than scripts have.
Unless this is a plugin, preventing the client from running code is often pointless unless it is targeted at a special exploit (such as esp, where you can check for changes to player characters)
Any anti exploit run on the client can be destroyed, broken by memory changes, and is overall a waste of time, as once one person shares how to break it, anyone with a script executer can break it.
Plus, any module that is require’d will likely not be parented, to anything, meaning you can’t find it without access to script source, but even then, scripts that executers run are often parented to nil or some container normal localscripts cannot access.
If this is a plugin, there are already plugins that do this, such as Kronos - Scan your game for viruses, backdoors - Plugin

1 Like