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

This Script Can Destroy your Game. Why?

Asked by 8 years ago

So I created a Script to be able to look through walls and The script can Destroy your place forever. By that I mean even by deleting the script after, the game remains destroyed. Errors Everywhere, scripts stop working, all sorts of code with variables become nil. I've already Destroyed two of my places. I don't know if this is a Roblox Bug or the script has the power to destroy a Place permanently. I couldn't reverse the process.

Here's the code, Use with caution, I've already warned you:

local player = game.Players.LocalPlayer

function lookforHumanoid()
    local child = workspace:GetChildren()
    for child, humanoid in pairs (child) do
        local outline = Instance.new("SelectionBox")
        if humanoid:IsA("BasePart") and humanoid.Name == "Humanoid" and outline.Parent ~= humanoid then
            outline.Parent = humanoid
            outline.Adornee = humanoid
            outline.SurfaceTransparency = 1
            outline.Transparency = 1
            outline.LineThickness = 0.5
            local Start = player.Character.Head.CFrame.p
            local End = humanoid.CFrame.p 
            local ray = Ray.new(Start,(End - Start).unit * 300)
        end
        if humanoid:IsA("BasePart") and humanoid.Name == "Humanoid" and outline.Parent == humanoid then
            local Start = player.Character.Head.CFrame.p
            local End = humanoid.CFrame.p 
            local ray = Ray.new(Start,(End - Start).unit * 300)
            local part, some = workspace:FindPartOnRay(ray,player.Character,false,false)
            if part and part.Name ~= "Humanoid" then
                outline.SurfaceTransparency = 0
                outline.Transparency = 0
            elseif part and part.Name == "Humanoid" then
                outline.SurfaceTransparency = 1
                outline.Transparency = 1
            end
        end
    end
end
player.Character.Humanoid.Changed:connect(lookforHumanoid)
0
This didn't crash/destroy anything of mine. Pyrondon 2089 — 8y
0
What Did it Do? Does it Work? Did you put it in a Local Script? GeezuzFusion 200 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

If you are saying it turns invisible, heres why:

You put a outline transparency as One. This causes many errors to occur, such as:

Script Errors Game Malfunctions, such as: Lag Exploding for No Reason

If this does not fix it then its probably the fact that multiple commands did NOT get finished. Such as "outline == humanoid then" and then a new command was started.

Ad

Answer this question