make this deny any request outgoing if it does not include "EXEC" in at least one of the execs -- This code was generated by Cobalt -- https://github.com/notpoiu/cobalt -- Event originated from an Actor Environment for _, actor in getactors() do
To modify the script to deny any outgoing request unless at least one of the arguments includes the string "EXEC", you need to add a check for the requested arguments before allowing the request to proceed. Below is the modified code that implements this functionality:
```lua
-- This code was generated by Cobalt
-- https://github.com/notpoiu/cobalt
-- Event originated from an Actor Environment
for _, actor in getactors() do
run_on_actor(actor, [[
local Event = game:GetService("ReplicatedStorage").Objects:GetChildren()[46559]
local mtHook; mtHook = hookmetamethod(game, "__namecall", function(...)
local self = ...
if rawequal(self, Event) and getnamecallmethod() == "FireServer" then
local Args = table.pack(...)
-- Check if any of the args contain "EXEC"
local hasExec = false
for _, arg in ipairs(Args) do
if typeof(arg) == "string" and string.find(arg, "EXEC") then
hasExec = true
break
end
end
if not hasExec then
print(`Denied request (__namecall) {Event.Name}:FireServer() - Missing EXEC`)
return -- Deny request
end
local Result = table.pack(
mtHook(self, table.unpack(Args, 1, Args.n))
)
print(`Intercepted (__namecall) {Event.Name}:FireServer()`, ...)
return table.unpack(Result, 1, Result.n)
end
return mtHook(...)
end)
local OldFireServer; OldFireServer = hookfunction(Event.FireServer, function(...)
local self = ...
if rawequal(self, Event) then
local Args = table.pack(...)
-- Check if any of the args contain "EXEC"
local hasExec = false
for _, arg in ipairs(Args) do
if typeof(arg) == "string" and string.find(arg, "EXEC") then
hasExec = true
break
end
end
if not hasExec then
print(`Denied request (__index) {Event.Name}:FireServer() - Missing EXEC`)
return -- Deny request
end
local Result = table.pack(
OldFireServer(table.unpack(Args, 1, Args.n))
)
print(`Intercepted (__index) {Event.Name}:FireServer()`, self, table.unpack(Result, 1, Result.n))
return table.unpack(Result, 1, Result.n)
end
return OldFireServer(self, ...)
end)
]])
end
```
### Changes Made:
1. Added a loop to check each argument of the function calls (both `__namecall` method and `FireServer` method).
2. Used `string.find` to check if any string argument contains the substring "EXEC".
3. If none of the arguments contains "EXEC", a message is printed and the request is denied by not calling further functions.
This way, if the "EXEC" condition is not met, the requests are denied, and appropriate messages are logged for both hooks.


