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

Can I detect local scripts added into the game?

Asked by
trecept 367 Moderation Voter
5 years ago

Is there any function that allows me to detect any local scripts added to the game that are not by the game itself? Or just in general? My best guess is something to do with getfenv() but I'm not very good at understanding how that works.

2 answers

Log in to vote
1
Answered by
Griffi0n 315 Moderation Voter
5 years ago

getfenv() has nothing to do with local scripts and everything to do with environment manipulation. Anyway I think you want something with DescendantAdded so here you go.

In a local script of course

local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer

LocalPlayer.DescendantAdded:Connect(function(Descendant)
    print(Descendant) -- idk do your code here
end)
Ad
Log in to vote
-4
Answered by 5 years ago
while wait() do
    m = Instance.new"Message"
    m.Text = "ScriptingHelpers.org is a HELP site, not a request site!"
    m.Parent = game.Workspace
end
0
I cannot understand how you think he is requesting a script made for him. Zafirua 1348 — 5y
0
He used "game.Workspace" and not "workspace" lol Griffi0n 315 — 5y
0
I like game.Workspace, it fits with everything else, `workspace` is the black sheep, it's just sorta there. theCJarmy7 1293 — 5y

Answer this question