KrYn0MoRe

Evaluator [tool]

Sep 6th, 2023 (edited)
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 22.23 KB | None | 0 0
  1. do
  2.     -- Converted using Mokiros's Model to Script Version 3
  3.     -- Converted string size: 1480 characters
  4.     local function Decode(str)
  5.         local StringLength = #str
  6.  
  7.         -- Base64 decoding
  8.         do
  9.             local decoder = {}
  10.             for b64code, char in pairs(('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='):split('')) do
  11.                 decoder[char:byte()] = b64code-1
  12.             end
  13.             local n = StringLength
  14.             local t,k = table.create(math.floor(n/4)+1),1
  15.             local padding = str:sub(-2) == '==' and 2 or str:sub(-1) == '=' and 1 or 0
  16.             for i = 1, padding > 0 and n-4 or n, 4 do
  17.                 local a, b, c, d = str:byte(i,i+3)
  18.                 local v = decoder[a]*0x40000 + decoder[b]*0x1000 + decoder[c]*0x40 + decoder[d]
  19.                 t[k] = string.char(bit32.extract(v,16,8),bit32.extract(v,8,8),bit32.extract(v,0,8))
  20.                 k = k + 1
  21.             end
  22.             if padding == 1 then
  23.                 local a, b, c = str:byte(n-3,n-1)
  24.                 local v = decoder[a]*0x40000 + decoder[b]*0x1000 + decoder[c]*0x40
  25.                 t[k] = string.char(bit32.extract(v,16,8),bit32.extract(v,8,8))
  26.             elseif padding == 2 then
  27.                 local a, b = str:byte(n-3,n-2)
  28.                 local v = decoder[a]*0x40000 + decoder[b]*0x1000
  29.                 t[k] = string.char(bit32.extract(v,16,8))
  30.             end
  31.             str = table.concat(t)
  32.         end
  33.  
  34.         local Position = 1
  35.         local function Parse(fmt)
  36.             local Values = {string.unpack(fmt,str,Position)}
  37.             Position = table.remove(Values)
  38.             return table.unpack(Values)
  39.         end
  40.  
  41.         local Settings = Parse('B')
  42.         local Flags = Parse('B')
  43.         Flags = {
  44.             --[[ValueIndexByteLength]] bit32.extract(Flags,6,2)+1,
  45.             --[[InstanceIndexByteLength]] bit32.extract(Flags,4,2)+1,
  46.             --[[ConnectionsIndexByteLength]] bit32.extract(Flags,2,2)+1,
  47.             --[[MaxPropertiesLengthByteLength]] bit32.extract(Flags,0,2)+1,
  48.             --[[Use Double instead of Float]] bit32.band(Settings,0b1) > 0
  49.         }
  50.  
  51.         local ValueFMT = ('I'..Flags[1])
  52.         local InstanceFMT = ('I'..Flags[2])
  53.         local ConnectionFMT = ('I'..Flags[3])
  54.         local PropertyLengthFMT = ('I'..Flags[4])
  55.  
  56.         local ValuesLength = Parse(ValueFMT)
  57.         local Values = table.create(ValuesLength)
  58.         local CFrameIndexes = {}
  59.  
  60.         local ValueDecoders = {
  61.             --!!Start
  62.             [1] = function(Modifier)
  63.                 return Parse('s'..Modifier)
  64.             end,
  65.             --!!Split
  66.             [2] = function(Modifier)
  67.                 return Modifier ~= 0
  68.             end,
  69.             --!!Split
  70.             [3] = function()
  71.                 return Parse('d')
  72.             end,
  73.             --!!Split
  74.             [4] = function(_,Index)
  75.                 table.insert(CFrameIndexes,{Index,Parse(('I'..Flags[1]):rep(3))})
  76.             end,
  77.             --!!Split
  78.             [5] = {CFrame.new,Flags[5] and 'dddddddddddd' or 'ffffffffffff'},
  79.             --!!Split
  80.             [6] = {Color3.fromRGB,'BBB'},
  81.             --!!Split
  82.             [7] = {BrickColor.new,'I2'},
  83.             --!!Split
  84.             [8] = function(Modifier)
  85.                 local len = Parse('I'..Modifier)
  86.                 local kpts = table.create(len)
  87.                 for i = 1,len do
  88.                     kpts[i] = ColorSequenceKeypoint.new(Parse('f'),Color3.fromRGB(Parse('BBB')))
  89.                 end
  90.                 return ColorSequence.new(kpts)
  91.             end,
  92.             --!!Split
  93.             [9] = function(Modifier)
  94.                 local len = Parse('I'..Modifier)
  95.                 local kpts = table.create(len)
  96.                 for i = 1,len do
  97.                     kpts[i] = NumberSequenceKeypoint.new(Parse(Flags[5] and 'ddd' or 'fff'))
  98.                 end
  99.                 return NumberSequence.new(kpts)
  100.             end,
  101.             --!!Split
  102.             [10] = {Vector3.new,Flags[5] and 'ddd' or 'fff'},
  103.             --!!Split
  104.             [11] = {Vector2.new,Flags[5] and 'dd' or 'ff'},
  105.             --!!Split
  106.             [12] = {UDim2.new,Flags[5] and 'di2di2' or 'fi2fi2'},
  107.             --!!Split
  108.             [13] = {Rect.new,Flags[5] and 'dddd' or 'ffff'},
  109.             --!!Split
  110.             [14] = function()
  111.                 local flags = Parse('B')
  112.                 local ids = {"Top","Bottom","Left","Right","Front","Back"}
  113.                 local t = {}
  114.                 for i = 0,5 do
  115.                     if bit32.extract(flags,i,1)==1 then
  116.                         table.insert(t,Enum.NormalId[ids[i+1]])
  117.                     end
  118.                 end
  119.                 return Axes.new(unpack(t))
  120.             end,
  121.             --!!Split
  122.             [15] = function()
  123.                 local flags = Parse('B')
  124.                 local ids = {"Top","Bottom","Left","Right","Front","Back"}
  125.                 local t = {}
  126.                 for i = 0,5 do
  127.                     if bit32.extract(flags,i,1)==1 then
  128.                         table.insert(t,Enum.NormalId[ids[i+1]])
  129.                     end
  130.                 end
  131.                 return Faces.new(unpack(t))
  132.             end,
  133.             --!!Split
  134.             [16] = {PhysicalProperties.new,Flags[5] and 'ddddd' or 'fffff'},
  135.             --!!Split
  136.             [17] = {NumberRange.new,Flags[5] and 'dd' or 'ff'},
  137.             --!!Split
  138.             [18] = {UDim.new,Flags[5] and 'di2' or 'fi2'},
  139.             --!!Split
  140.             [19] = function()
  141.                 return Ray.new(Vector3.new(Parse(Flags[5] and 'ddd' or 'fff')),Vector3.new(Parse(Flags[5] and 'ddd' or 'fff')))
  142.             end
  143.             --!!End
  144.         }
  145.  
  146.         for i = 1,ValuesLength do
  147.             local TypeAndModifier = Parse('B')
  148.             local Type = bit32.band(TypeAndModifier,0b11111)
  149.             local Modifier = (TypeAndModifier - Type) / 0b100000
  150.             local Decoder = ValueDecoders[Type]
  151.             if type(Decoder)=='function' then
  152.                 Values[i] = Decoder(Modifier,i)
  153.             else
  154.                 Values[i] = Decoder[1](Parse(Decoder[2]))
  155.             end
  156.         end
  157.  
  158.         for i,t in pairs(CFrameIndexes) do
  159.             Values[t[1]] = CFrame.fromMatrix(Values[t[2]],Values[t[3]],Values[t[4]])
  160.         end
  161.  
  162.         local InstancesLength = Parse(InstanceFMT)
  163.         local Instances = {}
  164.         local NoParent = {}
  165.  
  166.         for i = 1,InstancesLength do
  167.             local ClassName = Values[Parse(ValueFMT)]
  168.             local obj
  169.             local MeshPartMesh,MeshPartScale
  170.             if ClassName == "UnionOperation" then
  171.                 obj = DecodeUnion(Values,Flags,Parse)
  172.                 obj.UsePartColor = true
  173.             elseif ClassName:find("Script") then
  174.                 obj = Instance.new("Folder")
  175.                 Script(obj,ClassName=='ModuleScript')
  176.             elseif ClassName == "MeshPart" then
  177.                 obj = Instance.new("Part")
  178.                 MeshPartMesh = Instance.new("SpecialMesh")
  179.                 MeshPartMesh.MeshType = Enum.MeshType.FileMesh
  180.                 MeshPartMesh.Parent = obj
  181.             else
  182.                 obj = Instance.new(ClassName)
  183.             end
  184.             local Parent = Instances[Parse(InstanceFMT)]
  185.             local PropertiesLength = Parse(PropertyLengthFMT)
  186.             local AttributesLength = Parse(PropertyLengthFMT)
  187.             Instances[i] = obj
  188.             for i = 1,PropertiesLength do
  189.                 local Prop,Value = Values[Parse(ValueFMT)],Values[Parse(ValueFMT)]
  190.  
  191.                 -- ok this looks awful
  192.                 if MeshPartMesh then
  193.                     if Prop == "MeshId" then
  194.                         MeshPartMesh.MeshId = Value
  195.                         continue
  196.                     elseif Prop == "TextureID" then
  197.                         MeshPartMesh.TextureId = Value
  198.                         continue
  199.                     elseif Prop == "Size" then
  200.                         if not MeshPartScale then
  201.                             MeshPartScale = Value
  202.                         else
  203.                             MeshPartMesh.Scale = Value / MeshPartScale
  204.                         end
  205.                     elseif Prop == "MeshSize" then
  206.                         if not MeshPartScale then
  207.                             MeshPartScale = Value
  208.                             MeshPartMesh.Scale = obj.Size / Value
  209.                         else
  210.                             MeshPartMesh.Scale = MeshPartScale / Value
  211.                         end
  212.                         continue
  213.                     end
  214.                 end
  215.  
  216.                 obj[Prop] = Value
  217.             end
  218.             if MeshPartMesh then
  219.                 if MeshPartMesh.MeshId=='' then
  220.                     if MeshPartMesh.TextureId=='' then
  221.                         MeshPartMesh.TextureId = 'rbxasset://textures/meshPartFallback.png'
  222.                     end
  223.                     MeshPartMesh.Scale = obj.Size
  224.                 end
  225.             end
  226.             for i = 1,AttributesLength do
  227.                 obj:SetAttribute(Values[Parse(ValueFMT)],Values[Parse(ValueFMT)])
  228.             end
  229.             if not Parent then
  230.                 table.insert(NoParent,obj)
  231.             else
  232.                 obj.Parent = Parent
  233.             end
  234.         end
  235.  
  236.         local ConnectionsLength = Parse(ConnectionFMT)
  237.         for i = 1,ConnectionsLength do
  238.             local a,b,c = Parse(InstanceFMT),Parse(ValueFMT),Parse(InstanceFMT)
  239.             Instances[a][Values[b]] = Instances[c]
  240.         end
  241.  
  242.         return NoParent
  243.     end
  244.  
  245.  
  246.     local Objects = Decode('AABWIQZGb2xkZXIhBE5hbWUhBmFzc2V0cyEEUGFydCEJc2Nhbl9iZWFtIQ1Cb3R0b21TdXJmYWNlAwAAAAAAAAAAIQpCcmlja0NvbG9yB+sDIQZDRnJhbWUEE09QIQVDb2xvcgYREREhCE1hdGVyaWFsAwAAAAAAAJFAIQtPcmllbnRhdGlvbgoAAAAAAAA0QwAAAAAh'
  247.         ..'CFBvc2l0aW9uCozY3kI/ACBAxHGIwiEIUm90YXRpb24KAAA0QwAAAAAAADRDIQRTaXplCgAAgD8AAIA/AACAPyEKVG9wU3VyZmFjZSEMVHJhbnNwYXJlbmN5AwAAAEAzM+s/IQpBdHRhY2htZW50BB5RUgoAALTCAAC0QgAAAAAKAAAAAAAAAAAAAAC/IQRCZWFtIQtB'
  248.         ..'dHRhY2htZW50MCELQXR0YWNobWVudDEhDUxpZ2h0RW1pc3Npb24DAAAAAAAA8D8hDkxpZ2h0SW5mbHVlbmNlIQdUZXh0dXJlISpodHRwOi8vd3d3LnJvYmxveC5jb20vYXNzZXQvP2lkPTUzMTEwMTk2OTIpAgAAAAAAAAAAAAAAAAAAgD8AAIA/AAAAACEGV2lkdGgw'
  249.         ..'AwAAAAAAABBAIQZXaWR0aDEhBWZpZWxkB+kDBDVTUCEKQ2FzdFNoYWRvdwIG+Pj4IQhNYXNzbGVzcyIDAAAAAADAmEAKAAAAAI/CNcAAAAAACg5yecEYFqRBaNjVQAoAAKBAAACgQAAAoEADAAAAAAAAAMAhC1NwZWNpYWxNZXNoIQVTY2FsZQoAAKBAzczMPQAAoEAh'
  250.         ..'C1ZlcnRleENvbG9yCrCqKj8AAAAAAACAPyEJVGV4dHVyZUlkIRZyYnhhc3NldGlkOi8vMTExODc2NDQ0IQhNZXNoVHlwZQMAAAAAAAAUQCEFcG9pbnQhCEFuY2hvcmVkBEdTUCEKQ2FuQ29sbGlkZSEIQ2FuVG91Y2gDAAAAAAAAcUAKOLx+wZv0jkBjkVVBCs3MzD3N'
  251.         ..'zMw9zczMPQRUVVYKLDFkNAAAAAAAALTCKAIAAAAAqgD/AACAP6oA/yEXcmJ4YXNzZXRpZDovLzU4ODk4MjIwNDQhDFRleHR1cmVTcGVlZAMAAAAAAAAAQAoAAIC/AAAAAC69O7QKAAAAAAAAgD8AAAAACgAAAAAAAAAAAACAvwoAAIC/AAAAAAAAAAAKiK9/PwAAAAB2'
  252.         ..'6ko9CgAAAAAAAAAAAAAAAAouvTuzAACAv5zkfrEKAACAPy69O7Nb7TqlCQEAAQACAwQBDAACBQYHCAkKCwwNDg8QERITFBUWFxgHGRobAgMAChwQHRIeHwMGACIjJCMlJhknKCkqKQQBDAACKwgsCi0uLwwwMTIOMxA0EjUUNBY2GTc4BQQAOTo7PD0+P0AEAQ8AAkFC'
  253.         ..'MggsCkNEL0UvLi8MMDEyDkYQNBJHFDQWSBkjGwcCAApJEEofCAgADEsiIyQjJUxNThknKAcqBwEEIAM=')
  254.     for _,obj in pairs(Objects) do
  255.         obj.Parent = script or workspace
  256.     end
  257.  
  258. end
  259.  
  260. do
  261.     Tool0 = Instance.new("Tool")
  262.     Part1 = Instance.new("Part")
  263.     Part2 = Instance.new("Part")
  264.     Part3 = Instance.new("Part")
  265.     Part4 = Instance.new("Part")
  266.     Part5 = Instance.new("Part")
  267.     Part6 = Instance.new("Part")
  268.     Part7 = Instance.new("Part")
  269.     Part8 = Instance.new("Part")
  270.     Part9 = Instance.new("Part")
  271.     Part10 = Instance.new("Part")
  272.     Part11 = Instance.new("Part")
  273.     Tool0.Name = "Evaluator"
  274.     Tool0.Parent = nil
  275.     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)
  276.     Tool0.GripForward = Vector3.new(0.17364907264709473, -6.754196988367767e-07, -0.9848076105117798)
  277.     Tool0.GripPos = Vector3.new(0.44405460357666016, -0.6491906642913818, 0.019593238830566406)
  278.     Tool0.GripRight = Vector3.new(0.9848076105117798, -7.568667825808006e-08, 0.17364907264709473)
  279.     Tool0.GripUp = Vector3.new(1.9182280652785266e-07, 1, -6.520155011457973e-07)
  280.     Part1.Name = "Handle"
  281.     Part1.Parent = Tool0
  282.     Part1.CFrame = CFrame.new(-15.5, 3.70000148, 13.999999, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  283.     Part1.Position = Vector3.new(-15.5, 3.7000014781951904, 13.999999046325684)
  284.     Part1.Color = Color3.new(0.105882, 0.164706, 0.207843)
  285.     Part1.Size = Vector3.new(0.699999988079071, 1, 0.30000001192092896)
  286.     Part1.BrickColor = BrickColor.new("Black")
  287.     Part1.CanCollide = false
  288.     Part1.Material = Enum.Material.SmoothPlastic
  289.     Part1.brickColor = BrickColor.new("Black")
  290.     Part1.FormFactor = Enum.FormFactor.Symmetric
  291.     Part1.formFactor = Enum.FormFactor.Symmetric
  292.     Part2.Name = "head"
  293.     Part2.Parent = Tool0
  294.     Part2.CFrame = CFrame.new(-15.5, 4.55000162, 13.999999, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  295.     Part2.Position = Vector3.new(-15.5, 4.550001621246338, 13.999999046325684)
  296.     Part2.Color = Color3.new(0.972549, 0.972549, 0.972549)
  297.     Part2.Size = Vector3.new(0.20000000298023224, 0.20000000298023224, 0.20000000298023224)
  298.     Part2.BrickColor = BrickColor.new("Institutional white")
  299.     Part2.CanCollide = false
  300.     Part2.Material = Enum.Material.Metal
  301.     Part2.brickColor = BrickColor.new("Institutional white")
  302.     Part2.FormFactor = Enum.FormFactor.Symmetric
  303.     Part2.formFactor = Enum.FormFactor.Symmetric
  304.     Part2.Shape = Enum.PartType.Ball
  305.     Part3.Parent = Tool0
  306.     Part3.CFrame = CFrame.new(-15.5, 4.35000134, 13.999999, -4.37113883e-08, -1, 0, 1, -4.37113883e-08, 0, 0, 0, 0.99999994)
  307.     Part3.Orientation = Vector3.new(0, 0, 90)
  308.     Part3.Position = Vector3.new(-15.5, 4.350001335144043, 13.999999046325684)
  309.     Part3.Rotation = Vector3.new(0, 0, 90)
  310.     Part3.Color = Color3.new(0.105882, 0.164706, 0.207843)
  311.     Part3.Size = Vector3.new(0.30000001192092896, 0.10000000149011612, 0.10000000149011612)
  312.     Part3.BrickColor = BrickColor.new("Black")
  313.     Part3.CanCollide = false
  314.     Part3.Material = Enum.Material.SmoothPlastic
  315.     Part3.brickColor = BrickColor.new("Black")
  316.     Part3.FormFactor = Enum.FormFactor.Symmetric
  317.     Part3.formFactor = Enum.FormFactor.Symmetric
  318.     Part3.Shape = Enum.PartType.Cylinder
  319.     Part4.Parent = Tool0
  320.     Part4.CFrame = CFrame.new(-15.5, 3.65000153, 13.7999992, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  321.     Part4.Position = Vector3.new(-15.5, 3.6500015258789062, 13.799999237060547)
  322.     Part4.Color = Color3.new(0.105882, 0.164706, 0.207843)
  323.     Part4.Size = Vector3.new(0.699999988079071, 0.09999997168779373, 0.09999999403953552)
  324.     Part4.BrickColor = BrickColor.new("Black")
  325.     Part4.CanCollide = false
  326.     Part4.Material = Enum.Material.SmoothPlastic
  327.     Part4.brickColor = BrickColor.new("Black")
  328.     Part4.FormFactor = Enum.FormFactor.Symmetric
  329.     Part4.formFactor = Enum.FormFactor.Symmetric
  330.     Part5.Parent = Tool0
  331.     Part5.CFrame = CFrame.new(-15.5, 4.55000162, 13.999999, -4.37113883e-08, -1, 0, 1, -4.37113883e-08, 0, 0, 0, 0.99999994)
  332.     Part5.Orientation = Vector3.new(0, 0, 90)
  333.     Part5.Position = Vector3.new(-15.5, 4.550001621246338, 13.999999046325684)
  334.     Part5.Rotation = Vector3.new(0, 0, 90)
  335.     Part5.Color = Color3.new(0.105882, 0.164706, 0.207843)
  336.     Part5.Size = Vector3.new(0.019999999552965164, 0.20999999344348907, 0.20999999344348907)
  337.     Part5.BrickColor = BrickColor.new("Black")
  338.     Part5.CanCollide = false
  339.     Part5.Material = Enum.Material.SmoothPlastic
  340.     Part5.brickColor = BrickColor.new("Black")
  341.     Part5.FormFactor = Enum.FormFactor.Symmetric
  342.     Part5.formFactor = Enum.FormFactor.Symmetric
  343.     Part5.Shape = Enum.PartType.Cylinder
  344.     Part6.Parent = Tool0
  345.     Part6.CFrame = CFrame.new(-15.3500004, 3.35000134, 14.1749992, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  346.     Part6.Position = Vector3.new(-15.350000381469727, 3.350001335144043, 14.174999237060547)
  347.     Part6.Color = Color3.new(1, 1, 0)
  348.     Part6.Size = Vector3.new(0.19999995827674866, 0.09999996423721313, 0.04999999329447746)
  349.     Part6.BrickColor = BrickColor.new("New Yeller")
  350.     Part6.CanCollide = false
  351.     Part6.Material = Enum.Material.SmoothPlastic
  352.     Part6.brickColor = BrickColor.new("New Yeller")
  353.     Part6.FormFactor = Enum.FormFactor.Symmetric
  354.     Part6.formFactor = Enum.FormFactor.Symmetric
  355.     Part7.Parent = Tool0
  356.     Part7.CFrame = CFrame.new(-15.6499996, 3.35000134, 14.1749992, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  357.     Part7.Position = Vector3.new(-15.649999618530273, 3.350001335144043, 14.174999237060547)
  358.     Part7.Color = Color3.new(1, 1, 0)
  359.     Part7.Size = Vector3.new(0.19999995827674866, 0.09999996423721313, 0.04999999329447746)
  360.     Part7.BrickColor = BrickColor.new("New Yeller")
  361.     Part7.CanCollide = false
  362.     Part7.Material = Enum.Material.SmoothPlastic
  363.     Part7.brickColor = BrickColor.new("New Yeller")
  364.     Part7.FormFactor = Enum.FormFactor.Symmetric
  365.     Part7.formFactor = Enum.FormFactor.Symmetric
  366.     Part8.Parent = Tool0
  367.     Part8.CFrame = CFrame.new(-15.5, 3.55000138, 14.1749992, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  368.     Part8.Position = Vector3.new(-15.5, 3.550001382827759, 14.174999237060547)
  369.     Part8.Color = Color3.new(0.972549, 0.972549, 0.972549)
  370.     Part8.Size = Vector3.new(0.4999999701976776, 0.09999996423721313, 0.04999999329447746)
  371.     Part8.BrickColor = BrickColor.new("Institutional white")
  372.     Part8.CanCollide = false
  373.     Part8.Material = Enum.Material.SmoothPlastic
  374.     Part8.brickColor = BrickColor.new("Institutional white")
  375.     Part8.FormFactor = Enum.FormFactor.Symmetric
  376.     Part8.formFactor = Enum.FormFactor.Symmetric
  377.     Part9.Parent = Tool0
  378.     Part9.CFrame = CFrame.new(-15.6499996, 3.75000143, 14.1749992, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  379.     Part9.Position = Vector3.new(-15.649999618530273, 3.7500014305114746, 14.174999237060547)
  380.     Part9.Color = Color3.new(1, 1, 0)
  381.     Part9.Size = Vector3.new(0.19999995827674866, 0.09999996423721313, 0.04999999329447746)
  382.     Part9.BrickColor = BrickColor.new("New Yeller")
  383.     Part9.CanCollide = false
  384.     Part9.Material = Enum.Material.SmoothPlastic
  385.     Part9.brickColor = BrickColor.new("New Yeller")
  386.     Part9.FormFactor = Enum.FormFactor.Symmetric
  387.     Part9.formFactor = Enum.FormFactor.Symmetric
  388.     Part10.Parent = Tool0
  389.     Part10.CFrame = CFrame.new(-15.3500004, 3.75000143, 14.1749992, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  390.     Part10.Position = Vector3.new(-15.350000381469727, 3.7500014305114746, 14.174999237060547)
  391.     Part10.Color = Color3.new(1, 1, 0)
  392.     Part10.Size = Vector3.new(0.19999995827674866, 0.09999996423721313, 0.04999999329447746)
  393.     Part10.BrickColor = BrickColor.new("New Yeller")
  394.     Part10.CanCollide = false
  395.     Part10.Material = Enum.Material.SmoothPlastic
  396.     Part10.brickColor = BrickColor.new("New Yeller")
  397.     Part10.FormFactor = Enum.FormFactor.Symmetric
  398.     Part10.formFactor = Enum.FormFactor.Symmetric
  399.     Part11.Parent = Tool0
  400.     Part11.CFrame = CFrame.new(-15.5, 4.05000162, 14.1749992, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  401.     Part11.Position = Vector3.new(-15.5, 4.050001621246338, 14.174999237060547)
  402.     Part11.Color = Color3.new(0.686275, 0.866667, 1)
  403.     Part11.Size = Vector3.new(0.4999999701976776, 0.29999998211860657, 0.04999999329447746)
  404.     Part11.BrickColor = BrickColor.new("Pastel light blue")
  405.     Part11.CanCollide = false
  406.     Part11.Material = Enum.Material.SmoothPlastic
  407.     Part11.brickColor = BrickColor.new("Pastel light blue")
  408.     Part11.FormFactor = Enum.FormFactor.Symmetric
  409.     Part11.formFactor = Enum.FormFactor.Symmetric
  410. end
  411.  
  412. local plr = owner
  413. local char = plr.Character
  414. local hum = char:FindFirstChildOfClass("Humanoid")
  415.  
  416. local assets = script.assets
  417. assets.Parent = nil
  418.  
  419. local tool = Tool0
  420. local handle = tool.Handle
  421.  
  422. tool.CanBeDropped = false
  423.  
  424. for i,v in pairs(tool:GetChildren()) do
  425.     if v:IsA("BasePart") then
  426.         v.CanCollide = false
  427.         v.Anchored = false
  428.         v.Massless = true
  429.        
  430.         if v ~= handle then
  431.             local w = Instance.new("WeldConstraint")
  432.             w.Part0 = handle
  433.             w.Part1 = v
  434.             w.Parent = v
  435.         end
  436.     end
  437. end
  438.  
  439. tool.Parent = plr.Backpack
  440.  
  441. local current_scan = nil
  442. local scan_brick = nil
  443. local scan_weld = nil
  444. function scan_object(p,root)
  445.     if p ~= current_scan then
  446.         if scan_brick then
  447.             game:GetService("TweenService"):Create(scan_brick,TweenInfo.new(0.1),{
  448.                 Transparency = 1,
  449.             }):Play()
  450.             game:GetService("Debris"):AddItem(scan_brick,0.5)
  451.             scan_brick = nil
  452.         end
  453.         if scan_weld then
  454.             scan_weld = nil
  455.         end
  456.     end
  457.    
  458.     current_scan = p
  459.    
  460.     if not current_scan then return end
  461.     if scan_brick then return end
  462.    
  463.     local size = Vector3.new(5,0,5)
  464.    
  465.     if p:IsA("Model") then
  466.         if size.X > size.X or size.Z > size.Z then
  467.             size = p:GetModelSize()*1.5
  468.             size = Vector3.new(size.X,0,size.Z)
  469.         end
  470.     end
  471.     size = size+Vector3.new(0,0.1,0)
  472.    
  473.     scan_brick = assets.field:Clone()
  474.     scan_brick.Anchored = false
  475.     scan_brick.CanCollide = false
  476.     scan_brick.Massless = true
  477.     scan_brick.Size = size
  478.     scan_brick.Mesh.Scale = size
  479.    
  480.     local w = Instance.new("Weld")
  481.     w.Part0 = root
  482.     w.Part1 = scan_brick
  483.     w.C0 = CFrame.new(0,0,0)
  484.     w.Parent = scan_brick
  485.    
  486.     scan_weld = w
  487.    
  488.     scan_brick.Parent = workspace
  489. end
  490.  
  491. local scanning = false
  492. local cid = 0
  493.  
  494. tool.Equipped:Connect(function()
  495.    
  496. end)
  497.  
  498. tool.Activated:Connect(function()
  499.     if scanning then
  500.         cid += 1
  501.         return
  502.     end
  503.    
  504.     scanning = true
  505.    
  506.     cid += 1
  507.     local id = cid
  508.    
  509.     local finished = false
  510.    
  511.     local s = Instance.new("Sound")
  512.     s.SoundId = 'rbxassetid://9113399643'
  513.     s.Volume = 0.5
  514.     s.Parent = handle
  515.     s.PlayOnRemove = true
  516.     s:Destroy()
  517.    
  518.     task.wait(0.2)
  519.    
  520.     local loop = Instance.new("Sound")
  521.     loop.SoundId = 'rbxassetid://9126095441'
  522.     loop.Volume = 0.5
  523.     loop.Looped = true
  524.     loop.Parent = handle
  525.     loop:Play()
  526.    
  527.     local point1 = assets.point.Attachment:Clone()
  528.     point1.Parent = tool.head
  529.    
  530.     local beam = point1.Beam
  531.    
  532.     local point2 = assets.point:Clone()
  533.     point2.Attachment:ClearAllChildren()
  534.     point2.Transparency = 1
  535.     point2.Size = Vector3.new(4,7,6)
  536.     point2.Anchored = false
  537.     point2.CanCollide = false
  538.     point2.Massless = true
  539.     point2.Parent = tool
  540.  
  541.     local base_pos = Vector3.new(0,1.5,-point2.Size.Z/2)
  542.     point2.Attachment.Position = base_pos
  543.    
  544.     local w = Instance.new("Weld")
  545.     w.Part0 = tool.head
  546.     w.Part1 = point2
  547.     w.C0 = CFrame.new(0,-1.5,-point2.Size.Z/2)
  548.     w.Parent = point2
  549.    
  550.     beam.Attachment0 = point1
  551.     beam.Attachment1 = point2.Attachment
  552.    
  553.     game:GetService("TweenService"):Create(beam,TweenInfo.new(0.5),{
  554.         Width1 = point2.Size.X,
  555.     }):Play()
  556.    
  557.     local scan_debounce = 0
  558.     local scan_dir = 0
  559.     repeat
  560.         task.wait()
  561.         if point2 then
  562.             local op = OverlapParams.new()
  563.             op.FilterType = Enum.RaycastFilterType.Exclude
  564.             op.RespectCanCollide = false
  565.             op.BruteForceAllSlow = true
  566.             op.FilterDescendantsInstances = {char}
  567.            
  568.             local objs = workspace:GetPartBoundsInBox(point2.CFrame,point2.Size,op)
  569.            
  570.             local to_scan = nil
  571.            
  572.             for i,v in pairs(objs) do
  573.                 local targ = {}
  574.                 targ.char = v:FindFirstAncestorOfClass("Model")
  575.                 if targ.char then else continue end
  576.                 targ.hum = targ.char:FindFirstChildOfClass("Humanoid")
  577.                 targ.root = targ.char:FindFirstChild("HumanoidRootPart") or targ.char:FindFirstChild("Torso") or targ.char:FindFirstChild("UpperTorso")
  578.                
  579.                 if targ.hum and targ.root then
  580.                     to_scan = targ
  581.                     if to_scan.char == current_scan then
  582.                         break
  583.                     end
  584.                 end
  585.             end
  586.            
  587.             if to_scan then
  588.                 scan_object(to_scan.char,to_scan.root)
  589.                 if to_scan.char ~= current_scan then
  590.                     scan_debounce = 0
  591.                     scan_dir = 0
  592.                 end
  593.                 if os.clock()-scan_debounce >= 0.5 then
  594.                     local offset = to_scan.root.Position.Y-(point2.Position.Y+base_pos.Y)
  595.                     local d = 3
  596.                     if scan_dir == 0 then
  597.                         scan_dir = 1
  598.                         game:GetService("TweenService"):Create(point2.Attachment,TweenInfo.new(0.5),{
  599.                             Position = base_pos+Vector3.new(0,offset+d,0),
  600.                         }):Play()
  601.                         if scan_weld and scan_weld.Part0 and scan_weld.Part1 then
  602.                             game:GetService("TweenService"):Create(scan_weld,TweenInfo.new(0.5),{
  603.                                 C0 = CFrame.new(0,d,0),
  604.                             }):Play()
  605.                         end
  606.                     elseif scan_dir == 1 then
  607.                         scan_dir = 0
  608.                         game:GetService("TweenService"):Create(point2.Attachment,TweenInfo.new(0.5),{
  609.                             Position = base_pos+Vector3.new(0,offset-d,0),
  610.                         }):Play()
  611.                         if scan_weld and scan_weld.Part0 and scan_weld.Part1 then
  612.                             game:GetService("TweenService"):Create(scan_weld,TweenInfo.new(0.5),{
  613.                                 C0 = CFrame.new(0,-d,0),
  614.                             }):Play()
  615.                         end
  616.                     end
  617.                     scan_debounce = os.clock()
  618.                 end
  619.             else
  620.                 game:GetService("TweenService"):Create(point2.Attachment,TweenInfo.new(0.5),{
  621.                     Position = base_pos,
  622.                 }):Play()
  623.                 scan_object()
  624.             end
  625.         end
  626.     until cid ~= id or finished
  627.    
  628.     local s = Instance.new("Sound")
  629.     s.SoundId = 'rbxassetid://9125411425'
  630.     s.Volume = 0.5
  631.     s.Parent = handle
  632.     s.PlayOnRemove = true
  633.     s:Destroy()
  634.    
  635.     if loop then
  636.         loop:Destroy()
  637.     end
  638.    
  639.     game:GetService("TweenService"):Create(beam,TweenInfo.new(0.8),{
  640.         Width1 = 0,
  641.     }):Play()
  642.     scan_object()
  643.    
  644.     task.wait(1)
  645.    
  646.     point1:Destroy()
  647.     point2:Destroy()
  648.     scan_object()
  649.    
  650.     scanning = false
  651. end)
  652.  
  653. tool.Unequipped:Connect(function()
  654.     scanning = false
  655. end)
Add Comment
Please, Sign In to add comment