KamikazeJAM_YT

Booga Booga gold detector/ fog removal

Jun 10th, 2019
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.41 KB | None | 0 0
  1. _G.toggle = true
  2. local RunService = game:GetService("RunService")
  3. if game.GameId == 511839821 then
  4.     local folder = game.Workspace:FindFirstChild("GoldDetector")
  5.     if folder then
  6.         folder:ClearAllChildren()
  7.     else
  8.         folder = Instance.new("Folder", game.Workspace)
  9.         folder.Name = "GoldDetector"
  10.     end
  11.     local beacon = Instance.new("Part", folder)
  12.     beacon.Size = Vector3.new(3,1000,3)
  13.     beacon.Anchored = true
  14.     beacon.CanCollide = false
  15.     beacon.BrickColor = BrickColor.new("Gold")
  16.     beacon.Transparency = 0.5
  17.  
  18.     local part
  19.     local dist = math.huge
  20.  
  21.     function check(obj)
  22.         local player = game.Players.LocalPlayer
  23.         local character = player.Character or player.CharacterAdded:Wait()
  24.         local hrp = character:WaitForChild("HumanoidRootPart")
  25.         local CPos = hrp.Position
  26.         local testD = (obj.Position - CPos).magnitude
  27.         if testD < dist then
  28.             dist = testD
  29.             part = obj
  30.         end
  31.     end
  32.    
  33.     local guiObject = script.Parent
  34.      
  35.     local degreesPerSecond = 180
  36.      
  37.     local function onRenderStep(deltaTime)
  38.         local deltaRotation = deltaTime * degreesPerSecond
  39.         guiObject.Rotation = guiObject.Rotation + deltaRotation
  40.     end
  41.     RunService.RenderStepped:Connect(function()
  42.         if _G.toggle == true then
  43.             game.Lighting.FogEnd = 100000000
  44.             part = nil
  45.             dist = math.huge
  46.             for i, obj in pairs(game.Workspace:GetChildren()) do
  47.                 if obj.Name == "Ice Chunk" then
  48.                     local fold = obj:FindFirstChild("Breakaway")
  49.                     if fold then
  50.                         local mod = fold:FindFirstChild("Gold Node")
  51.                         if mod then
  52.                             local chunk = mod:FindFirstChild("Gold Node")
  53.                             if chunk then
  54.                                 check(chunk)
  55.                             end
  56.                         end
  57.                     end
  58.                 elseif obj.Name == "Gold Node" then
  59.                     local chunk = obj:FindFirstChild("Small Rock")
  60.                     if chunk then
  61.                         check(chunk)
  62.                     end
  63.                 end
  64.             end
  65.             if part ~= nil then
  66.                 beacon.Position = part.Position
  67.                
  68.                 local player = game.Players.LocalPlayer
  69.                 local character = player.Character or player.CharacterAdded:Wait()
  70.                 local head = character:WaitForChild("Head")
  71.                
  72.                 local ray = Ray.new(head.Position, (part.Position - head.Position).unit * 300)
  73.                 local partHit, partHitPos = workspace:FindPartOnRay(ray, player.Character, false, true)
  74.                
  75.                 local beam = folder:FindFirstChild("Beam")
  76.                 if not beam then
  77.                     beam = Instance.new("Part", folder)
  78.                     beam.Name = "Beam"
  79.                     beam.BrickColor = BrickColor.new("Bright red")
  80.                     beam.FormFactor = "Custom"
  81.                     beam.Material = "Neon"
  82.                     beam.Anchored = true
  83.                     beam.Locked = true
  84.                     beam.CanCollide = false
  85.                     beam.Transparency = 1
  86.                 end
  87.                
  88.                 local distance = (head.Position - part.Position).magnitude
  89.                 beam.Size = Vector3.new(0.3, 0.3, distance)
  90.                 beam.CFrame = CFrame.new(head.Position, part.Position) * CFrame.new(0, 0, -distance / 2)
  91.                
  92.                 local arrow = folder:FindFirstChild("Arrow")
  93.                 if not arrow then
  94.                     arrow = Instance.new("Part", folder)
  95.                 end
  96.                 arrow.Name = "Arrow"
  97.                 arrow.Size = Vector3.new(1.5,1,4)
  98.                 arrow.Anchored = true
  99.                 arrow.Transparency = 0.6
  100.                 arrow.CanCollide = false
  101.                 arrow.Position = head.Position + Vector3.new(0,2,0)
  102.                 arrow.Orientation = beam.Orientation
  103.                 arrow.TopSurface = Enum.SurfaceType.Smooth
  104.                 arrow.BottomSurface = Enum.SurfaceType.Smooth
  105.                 arrow.FrontSurface = Enum.SurfaceType.Hinge
  106.                 arrow.BrickColor = BrickColor.new("Gold")
  107.             end
  108.         else
  109.             folder:Destroy()
  110.             repeat
  111.                 wait()
  112.             until 1 == 2
  113.         end
  114.     end)
  115. end
Advertisement
Add Comment
Please, Sign In to add comment