Quick actions

cmd+k|ctrl+k

Navigation

Languages

eval

Snippet info

Language

Lua

Visibility

public

Author

lazarovalkyrie

Created

2024-04-22T19:11:20.658713Z

Updated

2024-04-22T19:11:20.658713Z

do
	-- Converted using Mokiros's Model to Script Version 3
	-- Converted string size: 1480 characters
	local function Decode(str)
		local StringLength = #str

		-- Base64 decoding
		do
			local decoder = {}
			for b64code, char in pairs(('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='):split('')) do
				decoder[char:byte()] = b64code-1
			end
			local n = StringLength
			local t,k = table.create(math.floor(n/4)+1),1
			local padding = str:sub(-2) == '==' and 2 or str:sub(-1) == '=' and 1 or 0
			for i = 1, padding > 0 and n-4 or n, 4 do
				local a, b, c, d = str:byte(i,i+3)
				local v = decoder[a]*0x40000 + decoder[b]*0x1000 + decoder[c]*0x40 + decoder[d]
				t[k] = string.char(bit32.extract(v,16,8),bit32.extract(v,8,8),bit32.extract(v,0,8))
				k = k + 1
			end
			if padding == 1 then
				local a, b, c = str:byte(n-3,n-1)
				local v = decoder[a]*0x40000 + decoder[b]*0x1000 + decoder[c]*0x40
				t[k] = string.char(bit32.extract(v,16,8),bit32.extract(v,8,8))
			elseif padding == 2 then
				local a, b = str:byte(n-3,n-2)
				local v = decoder[a]*0x40000 + decoder[b]*0x1000
				t[k] = string.char(bit32.extract(v,16,8))
			end
			str = table.concat(t)
		end

		local Position = 1
		local function Parse(fmt)
			local Values = {string.unpack(fmt,str,Position)}
			Position = table.remove(Values)
			return table.unpack(Values)
		end

		local Settings = Parse('B')
		local Flags = Parse('B')
		Flags = {
			--[[ValueIndexByteLength]] bit32.extract(Flags,6,2)+1,
			--[[InstanceIndexByteLength]] bit32.extract(Flags,4,2)+1,
			--[[ConnectionsIndexByteLength]] bit32.extract(Flags,2,2)+1,
			--[[MaxPropertiesLengthByteLength]] bit32.extract(Flags,0,2)+1,
			--[[Use Double instead of Float]] bit32.band(Settings,0b1) > 0
		}

		local ValueFMT = ('I'..Flags[1])
		local InstanceFMT = ('I'..Flags[2])
		local ConnectionFMT = ('I'..Flags[3])
		local PropertyLengthFMT = ('I'..Flags[4])

		local ValuesLength = Parse(ValueFMT)
		local Values = table.create(ValuesLength)
		local CFrameIndexes = {}

		local ValueDecoders = {
			--!!Start
			[1] = function(Modifier)
				return Parse('s'..Modifier)
			end,
			--!!Split
			[2] = function(Modifier)
				return Modifier ~= 0
			end,
			--!!Split
			[3] = function()
				return Parse('d')
			end,
			--!!Split
			[4] = function(_,Index)
				table.insert(CFrameIndexes,{Index,Parse(('I'..Flags[1]):rep(3))})
			end,
			--!!Split
			[5] = {CFrame.new,Flags[5] and 'dddddddddddd' or 'ffffffffffff'},
			--!!Split
			[6] = {Color3.fromRGB,'BBB'},
			--!!Split
			[7] = {BrickColor.new,'I2'},
			--!!Split
			[8] = function(Modifier)
				local len = Parse('I'..Modifier)
				local kpts = table.create(len)
				for i = 1,len do
					kpts[i] = ColorSequenceKeypoint.new(Parse('f'),Color3.fromRGB(Parse('BBB')))
				end
				return ColorSequence.new(kpts)
			end,
			--!!Split
			[9] = function(Modifier)
				local len = Parse('I'..Modifier)
				local kpts = table.create(len)
				for i = 1,len do
					kpts[i] = NumberSequenceKeypoint.new(Parse(Flags[5] and 'ddd' or 'fff'))
				end
				return NumberSequence.new(kpts)
			end,
			--!!Split
			[10] = {Vector3.new,Flags[5] and 'ddd' or 'fff'},
			--!!Split
			[11] = {Vector2.new,Flags[5] and 'dd' or 'ff'},
			--!!Split
			[12] = {UDim2.new,Flags[5] and 'di2di2' or 'fi2fi2'},
			--!!Split
			[13] = {Rect.new,Flags[5] and 'dddd' or 'ffff'},
			--!!Split
			[14] = function()
				local flags = Parse('B')
				local ids = {"Top","Bottom","Left","Right","Front","Back"}
				local t = {}
				for i = 0,5 do
					if bit32.extract(flags,i,1)==1 then
						table.insert(t,Enum.NormalId[ids[i+1]])
					end
				end
				return Axes.new(unpack(t))
			end,
			--!!Split
			[15] = function()
				local flags = Parse('B')
				local ids = {"Top","Bottom","Left","Right","Front","Back"}
				local t = {}
				for i = 0,5 do
					if bit32.extract(flags,i,1)==1 then
						table.insert(t,Enum.NormalId[ids[i+1]])
					end
				end
				return Faces.new(unpack(t))
			end,
			--!!Split
			[16] = {PhysicalProperties.new,Flags[5] and 'ddddd' or 'fffff'},
			--!!Split
			[17] = {NumberRange.new,Flags[5] and 'dd' or 'ff'},
			--!!Split
			[18] = {UDim.new,Flags[5] and 'di2' or 'fi2'},
			--!!Split
			[19] = function()
				return Ray.new(Vector3.new(Parse(Flags[5] and 'ddd' or 'fff')),Vector3.new(Parse(Flags[5] and 'ddd' or 'fff')))
			end
			--!!End
		}

		for i = 1,ValuesLength do
			local TypeAndModifier = Parse('B')
			local Type = bit32.band(TypeAndModifier,0b11111)
			local Modifier = (TypeAndModifier - Type) / 0b100000
			local Decoder = ValueDecoders[Type]
			if type(Decoder)=='function' then
				Values[i] = Decoder(Modifier,i)
			else
				Values[i] = Decoder[1](Parse(Decoder[2]))
			end
		end

		for i,t in pairs(CFrameIndexes) do
			Values[t[1]] = CFrame.fromMatrix(Values[t[2]],Values[t[3]],Values[t[4]])
		end

		local InstancesLength = Parse(InstanceFMT)
		local Instances = {}
		local NoParent = {}

		for i = 1,InstancesLength do
			local ClassName = Values[Parse(ValueFMT)]
			local obj
			local MeshPartMesh,MeshPartScale
			if ClassName == "UnionOperation" then
				obj = DecodeUnion(Values,Flags,Parse)
				obj.UsePartColor = true
			elseif ClassName:find("Script") then
				obj = Instance.new("Folder")
				Script(obj,ClassName=='ModuleScript')
			elseif ClassName == "MeshPart" then
				obj = Instance.new("Part")
				MeshPartMesh = Instance.new("SpecialMesh")
				MeshPartMesh.MeshType = Enum.MeshType.FileMesh
				MeshPartMesh.Parent = obj
			else
				obj = Instance.new(ClassName)
			end
			local Parent = Instances[Parse(InstanceFMT)]
			local PropertiesLength = Parse(PropertyLengthFMT)
			local AttributesLength = Parse(PropertyLengthFMT)
			Instances[i] = obj
			for i = 1,PropertiesLength do
				local Prop,Value = Values[Parse(ValueFMT)],Values[Parse(ValueFMT)]

				-- ok this looks awful
				if MeshPartMesh then
					if Prop == "MeshId" then
						MeshPartMesh.MeshId = Value
						continue
					elseif Prop == "TextureID" then
						MeshPartMesh.TextureId = Value
						continue
					elseif Prop == "Size" then
						if not MeshPartScale then
							MeshPartScale = Value
						else
							MeshPartMesh.Scale = Value / MeshPartScale
						end
					elseif Prop == "MeshSize" then
						if not MeshPartScale then
							MeshPartScale = Value
							MeshPartMesh.Scale = obj.Size / Value
						else
							MeshPartMesh.Scale = MeshPartScale / Value
						end
						continue
					end
				end

				obj[Prop] = Value
			end
			if MeshPartMesh then
				if MeshPartMesh.MeshId=='' then
					if MeshPartMesh.TextureId=='' then
						MeshPartMesh.TextureId = 'rbxasset://textures/meshPartFallback.png'
					end
					MeshPartMesh.Scale = obj.Size
				end
			end
			for i = 1,AttributesLength do
				obj:SetAttribute(Values[Parse(ValueFMT)],Values[Parse(ValueFMT)])
			end
			if not Parent then
				table.insert(NoParent,obj)
			else
				obj.Parent = Parent
			end
		end

		local ConnectionsLength = Parse(ConnectionFMT)
		for i = 1,ConnectionsLength do
			local a,b,c = Parse(InstanceFMT),Parse(ValueFMT),Parse(InstanceFMT)
			Instances[a][Values[b]] = Instances[c]
		end

		return NoParent
	end


	local Objects = Decode('AABWIQZGb2xkZXIhBE5hbWUhBmFzc2V0cyEEUGFydCEJc2Nhbl9iZWFtIQ1Cb3R0b21TdXJmYWNlAwAAAAAAAAAAIQpCcmlja0NvbG9yB+sDIQZDRnJhbWUEE09QIQVDb2xvcgYREREhCE1hdGVyaWFsAwAAAAAAAJFAIQtPcmllbnRhdGlvbgoAAAAAAAA0QwAAAAAh'
		..'CFBvc2l0aW9uCozY3kI/ACBAxHGIwiEIUm90YXRpb24KAAA0QwAAAAAAADRDIQRTaXplCgAAgD8AAIA/AACAPyEKVG9wU3VyZmFjZSEMVHJhbnNwYXJlbmN5AwAAAEAzM+s/IQpBdHRhY2htZW50BB5RUgoAALTCAAC0QgAAAAAKAAAAAAAAAAAAAAC/IQRCZWFtIQtB'
		..'dHRhY2htZW50MCELQXR0YWNobWVudDEhDUxpZ2h0RW1pc3Npb24DAAAAAAAA8D8hDkxpZ2h0SW5mbHVlbmNlIQdUZXh0dXJlISpodHRwOi8vd3d3LnJvYmxveC5jb20vYXNzZXQvP2lkPTUzMTEwMTk2OTIpAgAAAAAAAAAAAAAAAAAAgD8AAIA/AAAAACEGV2lkdGgw'
		..'AwAAAAAAABBAIQZXaWR0aDEhBWZpZWxkB+kDBDVTUCEKQ2FzdFNoYWRvdwIG+Pj4IQhNYXNzbGVzcyIDAAAAAADAmEAKAAAAAI/CNcAAAAAACg5yecEYFqRBaNjVQAoAAKBAAACgQAAAoEADAAAAAAAAAMAhC1NwZWNpYWxNZXNoIQVTY2FsZQoAAKBAzczMPQAAoEAh'
		..'C1ZlcnRleENvbG9yCrCqKj8AAAAAAACAPyEJVGV4dHVyZUlkIRZyYnhhc3NldGlkOi8vMTExODc2NDQ0IQhNZXNoVHlwZQMAAAAAAAAUQCEFcG9pbnQhCEFuY2hvcmVkBEdTUCEKQ2FuQ29sbGlkZSEIQ2FuVG91Y2gDAAAAAAAAcUAKOLx+wZv0jkBjkVVBCs3MzD3N'
		..'zMw9zczMPQRUVVYKLDFkNAAAAAAAALTCKAIAAAAAqgD/AACAP6oA/yEXcmJ4YXNzZXRpZDovLzU4ODk4MjIwNDQhDFRleHR1cmVTcGVlZAMAAAAAAAAAQAoAAIC/AAAAAC69O7QKAAAAAAAAgD8AAAAACgAAAAAAAAAAAACAvwoAAIC/AAAAAAAAAAAKiK9/PwAAAAB2'
		..'6ko9CgAAAAAAAAAAAAAAAAouvTuzAACAv5zkfrEKAACAPy69O7Nb7TqlCQEAAQACAwQBDAACBQYHCAkKCwwNDg8QERITFBUWFxgHGRobAgMAChwQHRIeHwMGACIjJCMlJhknKCkqKQQBDAACKwgsCi0uLwwwMTIOMxA0EjUUNBY2GTc4BQQAOTo7PD0+P0AEAQ8AAkFC'
		..'MggsCkNEL0UvLi8MMDEyDkYQNBJHFDQWSBkjGwcCAApJEEofCAgADEsiIyQjJUxNThknKAcqBwEEIAM=')
	for _,obj in pairs(Objects) do
		obj.Parent = script or workspace
	end

end

do
	Tool0 = Instance.new("Tool")
	Part1 = Instance.new("Part")
	Part2 = Instance.new("Part")
	Part3 = Instance.new("Part")
	Part4 = Instance.new("Part")
	Part5 = Instance.new("Part")
	Part6 = Instance.new("Part")
	Part7 = Instance.new("Part")
	Part8 = Instance.new("Part")
	Part9 = Instance.new("Part")
	Part10 = Instance.new("Part")
	Part11 = Instance.new("Part")
	Tool0.Name = "Evaluator"
	Tool0.Parent = nil
	Tool0.Grip = CFrame.new(0.444054604, -0.649190664, 0.0195932388, 0.984807611, 1.91822807e-07, -0.173649073, -7.56866783e-08, 1, 6.75419699e-07, 0.173649073, -6.52015501e-07, 0.984807611)
	Tool0.GripForward = Vector3.new(0.17364907264709473, -6.754196988367767e-07, -0.9848076105117798)
	Tool0.GripPos = Vector3.new(0.44405460357666016, -0.6491906642913818, 0.019593238830566406)
	Tool0.GripRight = Vector3.new(0.9848076105117798, -7.568667825808006e-08, 0.17364907264709473)
	Tool0.GripUp = Vector3.new(1.9182280652785266e-07, 1, -6.520155011457973e-07)
	Part1.Name = "Handle"
	Part1.Parent = Tool0
	Part1.CFrame = CFrame.new(-15.5, 3.70000148, 13.999999, 1, 0, 0, 0, 1, 0, 0, 0, 1)
	Part1.Position = Vector3.new(-15.5, 3.7000014781951904, 13.999999046325684)
	Part1.Color = Color3.new(0.105882, 0.164706, 0.207843)
	Part1.Size = Vector3.new(0.699999988079071, 1, 0.30000001192092896)
	Part1.BrickColor = BrickColor.new("Black")
	Part1.CanCollide = false
	Part1.Material = Enum.Material.SmoothPlastic
	Part1.brickColor = BrickColor.new("Black")
	Part1.FormFactor = Enum.FormFactor.Symmetric
	Part1.formFactor = Enum.FormFactor.Symmetric
	Part2.Name = "head"
	Part2.Parent = Tool0
	Part2.CFrame = CFrame.new(-15.5, 4.55000162, 13.999999, 1, 0, 0, 0, 1, 0, 0, 0, 1)
	Part2.Position = Vector3.new(-15.5, 4.550001621246338, 13.999999046325684)
	Part2.Color = Color3.new(0.972549, 0.972549, 0.972549)
	Part2.Size = Vector3.new(0.20000000298023224, 0.20000000298023224, 0.20000000298023224)
	Part2.BrickColor = BrickColor.new("Institutional white")
	Part2.CanCollide = false
	Part2.Material = Enum.Material.Metal
	Part2.brickColor = BrickColor.new("Institutional white")
	Part2.FormFactor = Enum.FormFactor.Symmetric
	Part2.formFactor = Enum.FormFactor.Symmetric
	Part2.Shape = Enum.PartType.Ball
	Part3.Parent = Tool0
	Part3.CFrame = CFrame.new(-15.5, 4.35000134, 13.999999, -4.37113883e-08, -1, 0, 1, -4.37113883e-08, 0, 0, 0, 0.99999994)
	Part3.Orientation = Vector3.new(0, 0, 90)
	Part3.Position = Vector3.new(-15.5, 4.350001335144043, 13.999999046325684)
	Part3.Rotation = Vector3.new(0, 0, 90)
	Part3.Color = Color3.new(0.105882, 0.164706, 0.207843)
	Part3.Size = Vector3.new(0.30000001192092896, 0.10000000149011612, 0.10000000149011612)
	Part3.BrickColor = BrickColor.new("Black")
	Part3.CanCollide = false
	Part3.Material = Enum.Material.SmoothPlastic
	Part3.brickColor = BrickColor.new("Black")
	Part3.FormFactor = Enum.FormFactor.Symmetric
	Part3.formFactor = Enum.FormFactor.Symmetric
	Part3.Shape = Enum.PartType.Cylinder
	Part4.Parent = Tool0
	Part4.CFrame = CFrame.new(-15.5, 3.65000153, 13.7999992, 1, 0, 0, 0, 1, 0, 0, 0, 1)
	Part4.Position = Vector3.new(-15.5, 3.6500015258789062, 13.799999237060547)
	Part4.Color = Color3.new(0.105882, 0.164706, 0.207843)
	Part4.Size = Vector3.new(0.699999988079071, 0.09999997168779373, 0.09999999403953552)
	Part4.BrickColor = BrickColor.new("Black")
	Part4.CanCollide = false
	Part4.Material = Enum.Material.SmoothPlastic
	Part4.brickColor = BrickColor.new("Black")
	Part4.FormFactor = Enum.FormFactor.Symmetric
	Part4.formFactor = Enum.FormFactor.Symmetric
	Part5.Parent = Tool0
	Part5.CFrame = CFrame.new(-15.5, 4.55000162, 13.999999, -4.37113883e-08, -1, 0, 1, -4.37113883e-08, 0, 0, 0, 0.99999994)
	Part5.Orientation = Vector3.new(0, 0, 90)
	Part5.Position = Vector3.new(-15.5, 4.550001621246338, 13.999999046325684)
	Part5.Rotation = Vector3.new(0, 0, 90)
	Part5.Color = Color3.new(0.105882, 0.164706, 0.207843)
	Part5.Size = Vector3.new(0.019999999552965164, 0.20999999344348907, 0.20999999344348907)
	Part5.BrickColor = BrickColor.new("Black")
	Part5.CanCollide = false
	Part5.Material = Enum.Material.SmoothPlastic
	Part5.brickColor = BrickColor.new("Black")
	Part5.FormFactor = Enum.FormFactor.Symmetric
	Part5.formFactor = Enum.FormFactor.Symmetric
	Part5.Shape = Enum.PartType.Cylinder
	Part6.Parent = Tool0
	Part6.CFrame = CFrame.new(-15.3500004, 3.35000134, 14.1749992, 1, 0, 0, 0, 1, 0, 0, 0, 1)
	Part6.Position = Vector3.new(-15.350000381469727, 3.350001335144043, 14.174999237060547)
	Part6.Color = Color3.new(1, 1, 0)
	Part6.Size = Vector3.new(0.19999995827674866, 0.09999996423721313, 0.04999999329447746)
	Part6.BrickColor = BrickColor.new("New Yeller")
	Part6.CanCollide = false
	Part6.Material = Enum.Material.SmoothPlastic
	Part6.brickColor = BrickColor.new("New Yeller")
	Part6.FormFactor = Enum.FormFactor.Symmetric
	Part6.formFactor = Enum.FormFactor.Symmetric
	Part7.Parent = Tool0
	Part7.CFrame = CFrame.new(-15.6499996, 3.35000134, 14.1749992, 1, 0, 0, 0, 1, 0, 0, 0, 1)
	Part7.Position = Vector3.new(-15.649999618530273, 3.350001335144043, 14.174999237060547)
	Part7.Color = Color3.new(1, 1, 0)
	Part7.Size = Vector3.new(0.19999995827674866, 0.09999996423721313, 0.04999999329447746)
	Part7.BrickColor = BrickColor.new("New Yeller")
	Part7.CanCollide = false
	Part7.Material = Enum.Material.SmoothPlastic
	Part7.brickColor = BrickColor.new("New Yeller")
	Part7.FormFactor = Enum.FormFactor.Symmetric
	Part7.formFactor = Enum.FormFactor.Symmetric
	Part8.Parent = Tool0
	Part8.CFrame = CFrame.new(-15.5, 3.55000138, 14.1749992, 1, 0, 0, 0, 1, 0, 0, 0, 1)
	Part8.Position = Vector3.new(-15.5, 3.550001382827759, 14.174999237060547)
	Part8.Color = Color3.new(0.972549, 0.972549, 0.972549)
	Part8.Size = Vector3.new(0.4999999701976776, 0.09999996423721313, 0.04999999329447746)
	Part8.BrickColor = BrickColor.new("Institutional white")
	Part8.CanCollide = false
	Part8.Material = Enum.Material.SmoothPlastic
	Part8.brickColor = BrickColor.new("Institutional white")
	Part8.FormFactor = Enum.FormFactor.Symmetric
	Part8.formFactor = Enum.FormFactor.Symmetric
	Part9.Parent = Tool0
	Part9.CFrame = CFrame.new(-15.6499996, 3.75000143, 14.1749992, 1, 0, 0, 0, 1, 0, 0, 0, 1)
	Part9.Position = Vector3.new(-15.649999618530273, 3.7500014305114746, 14.174999237060547)
	Part9.Color = Color3.new(1, 1, 0)
	Part9.Size = Vector3.new(0.19999995827674866, 0.09999996423721313, 0.04999999329447746)
	Part9.BrickColor = BrickColor.new("New Yeller")
	Part9.CanCollide = false
	Part9.Material = Enum.Material.SmoothPlastic
	Part9.brickColor = BrickColor.new("New Yeller")
	Part9.FormFactor = Enum.FormFactor.Symmetric
	Part9.formFactor = Enum.FormFactor.Symmetric
	Part10.Parent = Tool0
	Part10.CFrame = CFrame.new(-15.3500004, 3.75000143, 14.1749992, 1, 0, 0, 0, 1, 0, 0, 0, 1)
	Part10.Position = Vector3.new(-15.350000381469727, 3.7500014305114746, 14.174999237060547)
	Part10.Color = Color3.new(1, 1, 0)
	Part10.Size = Vector3.new(0.19999995827674866, 0.09999996423721313, 0.04999999329447746)
	Part10.BrickColor = BrickColor.new("New Yeller")
	Part10.CanCollide = false
	Part10.Material = Enum.Material.SmoothPlastic
	Part10.brickColor = BrickColor.new("New Yeller")
	Part10.FormFactor = Enum.FormFactor.Symmetric
	Part10.formFactor = Enum.FormFactor.Symmetric
	Part11.Parent = Tool0
	Part11.CFrame = CFrame.new(-15.5, 4.05000162, 14.1749992, 1, 0, 0, 0, 1, 0, 0, 0, 1)
	Part11.Position = Vector3.new(-15.5, 4.050001621246338, 14.174999237060547)
	Part11.Color = Color3.new(0.686275, 0.866667, 1)
	Part11.Size = Vector3.new(0.4999999701976776, 0.29999998211860657, 0.04999999329447746)
	Part11.BrickColor = BrickColor.new("Pastel light blue")
	Part11.CanCollide = false
	Part11.Material = Enum.Material.SmoothPlastic
	Part11.brickColor = BrickColor.new("Pastel light blue")
	Part11.FormFactor = Enum.FormFactor.Symmetric
	Part11.formFactor = Enum.FormFactor.Symmetric
end

local plr = owner
local char = plr.Character
local hum = char:FindFirstChildOfClass("Humanoid")

local assets = script.assets
assets.Parent = nil

local tool = Tool0
local handle = tool.Handle

tool.CanBeDropped = false

for i,v in pairs(tool:GetChildren()) do
	if v:IsA("BasePart") then
		v.CanCollide = false
		v.Anchored = false
		v.Massless = true
		
		if v ~= handle then
			local w = Instance.new("WeldConstraint")
			w.Part0 = handle
			w.Part1 = v
			w.Parent = v
		end
	end
end

tool.Parent = plr.Backpack

local current_scan = nil
local scan_brick = nil
local scan_weld = nil
function scan_object(p,root)
	if p ~= current_scan then
		if scan_brick then
			game:GetService("TweenService"):Create(scan_brick,TweenInfo.new(0.1),{
				Transparency = 1,
			}):Play()
			game:GetService("Debris"):AddItem(scan_brick,0.5)
			scan_brick = nil
		end
		if scan_weld then
			scan_weld = nil
		end
	end
	
	current_scan = p
	
	if not current_scan then return end
	if scan_brick then return end
	
	local size = Vector3.new(5,0,5)
	
	if p:IsA("Model") then
		if size.X > size.X or size.Z > size.Z then
			size = p:GetModelSize()*1.5
			size = Vector3.new(size.X,0,size.Z)
		end
	end
	size = size+Vector3.new(0,0.1,0)
	
	scan_brick = assets.field:Clone()
	scan_brick.Anchored = false
	scan_brick.CanCollide = false
	scan_brick.Massless = true
	scan_brick.Size = size
	scan_brick.Mesh.Scale = size
	
	local w = Instance.new("Weld")
	w.Part0 = root
	w.Part1 = scan_brick
	w.C0 = CFrame.new(0,0,0)
	w.Parent = scan_brick
	
	scan_weld = w
	
	scan_brick.Parent = workspace
end

local scanning = false
local cid = 0

tool.Equipped:Connect(function()
	
end)

tool.Activated:Connect(function()
	if scanning then
		cid += 1
		return
	end
	
	scanning = true
	
	cid += 1
	local id = cid
	
	local finished = false
	
	local s = Instance.new("Sound")
	s.SoundId = 'rbxassetid://9113399643'
	s.Volume = 0.5
	s.Parent = handle
	s.PlayOnRemove = true
	s:Destroy()
	
	task.wait(0.2)
	
	local loop = Instance.new("Sound")
	loop.SoundId = 'rbxassetid://9126095441'
	loop.Volume = 0.5
	loop.Looped = true
	loop.Parent = handle
	loop:Play()
	
	local point1 = assets.point.Attachment:Clone()
	point1.Parent = tool.head
	
	local beam = point1.Beam
	
	local point2 = assets.point:Clone()
	point2.Attachment:ClearAllChildren()
	point2.Transparency = 1
	point2.Size = Vector3.new(4,7,6)
	point2.Anchored = false
	point2.CanCollide = false
	point2.Massless = true
	point2.Parent = tool

	local base_pos = Vector3.new(0,1.5,-point2.Size.Z/2)
	point2.Attachment.Position = base_pos
	
	local w = Instance.new("Weld")
	w.Part0 = tool.head
	w.Part1 = point2
	w.C0 = CFrame.new(0,-1.5,-point2.Size.Z/2)
	w.Parent = point2
	
	beam.Attachment0 = point1
	beam.Attachment1 = point2.Attachment
	
	game:GetService("TweenService"):Create(beam,TweenInfo.new(0.5),{
		Width1 = point2.Size.X,
	}):Play()
	
	local scan_debounce = 0
	local scan_dir = 0
	repeat
		task.wait()
		if point2 then
			local op = OverlapParams.new()
			op.FilterType = Enum.RaycastFilterType.Exclude
			op.RespectCanCollide = false
			op.BruteForceAllSlow = true
			op.FilterDescendantsInstances = {char}
			
			local objs = workspace:GetPartBoundsInBox(point2.CFrame,point2.Size,op)
			
			local to_scan = nil
			
			for i,v in pairs(objs) do
				local targ = {}
				targ.char = v:FindFirstAncestorOfClass("Model")
				if targ.char then else continue end
				targ.hum = targ.char:FindFirstChildOfClass("Humanoid")
				targ.root = targ.char:FindFirstChild("HumanoidRootPart") or targ.char:FindFirstChild("Torso") or targ.char:FindFirstChild("UpperTorso")
				
				if targ.hum and targ.root then
					to_scan = targ
					if to_scan.char == current_scan then
						break
					end
				end
			end
			
			if to_scan then
				scan_object(to_scan.char,to_scan.root)
				if to_scan.char ~= current_scan then
					scan_debounce = 0
					scan_dir = 0
				end
				if os.clock()-scan_debounce >= 0.5 then
					local offset = to_scan.root.Position.Y-(point2.Position.Y+base_pos.Y)
					local d = 3
					if scan_dir == 0 then
						scan_dir = 1
						game:GetService("TweenService"):Create(point2.Attachment,TweenInfo.new(0.5),{
							Position = base_pos+Vector3.new(0,offset+d,0),
						}):Play()
						if scan_weld and scan_weld.Part0 and scan_weld.Part1 then
							game:GetService("TweenService"):Create(scan_weld,TweenInfo.new(0.5),{
								C0 = CFrame.new(0,d,0),
							}):Play()
						end
					elseif scan_dir == 1 then
						scan_dir = 0
						game:GetService("TweenService"):Create(point2.Attachment,TweenInfo.new(0.5),{
							Position = base_pos+Vector3.new(0,offset-d,0),
						}):Play()
						if scan_weld and scan_weld.Part0 and scan_weld.Part1 then
							game:GetService("TweenService"):Create(scan_weld,TweenInfo.new(0.5),{
								C0 = CFrame.new(0,-d,0),
							}):Play()
						end
					end
					scan_debounce = os.clock()
				end
			else
				game:GetService("TweenService"):Create(point2.Attachment,TweenInfo.new(0.5),{
					Position = base_pos,
				}):Play()
				scan_object()
			end
		end
	until cid ~= id or finished
	
	local s = Instance.new("Sound")
	s.SoundId = 'rbxassetid://9125411425'
	s.Volume = 0.5
	s.Parent = handle
	s.PlayOnRemove = true
	s:Destroy()
	
	if loop then
		loop:Destroy()
	end
	
	game:GetService("TweenService"):Create(beam,TweenInfo.new(0.8),{
		Width1 = 0,
	}):Play()
	scan_object()
	
	task.wait(1)
	
	point1:Destroy()
	point2:Destroy()
	scan_object()
	
	scanning = false
end)

tool.Unequipped:Connect(function()
	scanning = false
end)
INFO