Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

This Script Can Destroy your Game. Why?

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)

2 comments

0

This didn't crash/destroy anything of mine.

0

What Did it Do? Does it Work? Did you put it in a Local Script?

1 answer

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.