Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

The current identity (2) cannot Source (lacking permission 1) script.Source? [SOLVED]

Asked by 2 years ago
Edited 2 years ago

I want to make make a virus detector on my game and i used script.Source but it give me this error.

Did i use script.Source the wrong way?

LocalScript:

local requires = 0
for _,t:Script in pairs(game.Workspace:GetDescendants()) do
    if t:IsA("Script") then
    if not string.find(t.Parent.Name, "Class") and t.Name ~= "handler" then
        if string.find(t.Source, "require") then --This line
            requires += 1
        end
        end
    end
end

script.Parent.Requires.Text = "Requires: ".. tostring(requires)

1 answer

Log in to vote
0
Answered by 2 years ago

I found out that script.Source cannot be used in a Script or a LocalScript.

I'm gonna make this a plugin :)

Ad

Answer this question