Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- _G.toggle = true
- local RunService = game:GetService("RunService")
- if game.GameId == 511839821 then
- local folder = game.Workspace:FindFirstChild("GoldDetector")
- if folder then
- folder:ClearAllChildren()
- else
- folder = Instance.new("Folder", game.Workspace)
- folder.Name = "GoldDetector"
- end
- local beacon = Instance.new("Part", folder)
- beacon.Size = Vector3.new(3,1000,3)
- beacon.Anchored = true
- beacon.CanCollide = false
- beacon.BrickColor = BrickColor.new("Gold")
- beacon.Transparency = 0.5
- local part
- local dist = math.huge
- function check(obj)
- local player = game.Players.LocalPlayer
- local character = player.Character or player.CharacterAdded:Wait()
- local hrp = character:WaitForChild("HumanoidRootPart")
- local CPos = hrp.Position
- local testD = (obj.Position - CPos).magnitude
- if testD < dist then
- dist = testD
- part = obj
- end
- end
- local guiObject = script.Parent
- local degreesPerSecond = 180
- local function onRenderStep(deltaTime)
- local deltaRotation = deltaTime * degreesPerSecond
- guiObject.Rotation = guiObject.Rotation + deltaRotation
- end
- RunService.RenderStepped:Connect(function()
- if _G.toggle == true then
- game.Lighting.FogEnd = 100000000
- part = nil
- dist = math.huge
- for i, obj in pairs(game.Workspace:GetChildren()) do
- if obj.Name == "Ice Chunk" then
- local fold = obj:FindFirstChild("Breakaway")
- if fold then
- local mod = fold:FindFirstChild("Gold Node")
- if mod then
- local chunk = mod:FindFirstChild("Gold Node")
- if chunk then
- check(chunk)
- end
- end
- end
- elseif obj.Name == "Gold Node" then
- local chunk = obj:FindFirstChild("Small Rock")
- if chunk then
- check(chunk)
- end
- end
- end
- if part ~= nil then
- beacon.Position = part.Position
- local player = game.Players.LocalPlayer
- local character = player.Character or player.CharacterAdded:Wait()
- local head = character:WaitForChild("Head")
- local ray = Ray.new(head.Position, (part.Position - head.Position).unit * 300)
- local partHit, partHitPos = workspace:FindPartOnRay(ray, player.Character, false, true)
- local beam = folder:FindFirstChild("Beam")
- if not beam then
- beam = Instance.new("Part", folder)
- beam.Name = "Beam"
- beam.BrickColor = BrickColor.new("Bright red")
- beam.FormFactor = "Custom"
- beam.Material = "Neon"
- beam.Anchored = true
- beam.Locked = true
- beam.CanCollide = false
- beam.Transparency = 1
- end
- local distance = (head.Position - part.Position).magnitude
- beam.Size = Vector3.new(0.3, 0.3, distance)
- beam.CFrame = CFrame.new(head.Position, part.Position) * CFrame.new(0, 0, -distance / 2)
- local arrow = folder:FindFirstChild("Arrow")
- if not arrow then
- arrow = Instance.new("Part", folder)
- end
- arrow.Name = "Arrow"
- arrow.Size = Vector3.new(1.5,1,4)
- arrow.Anchored = true
- arrow.Transparency = 0.6
- arrow.CanCollide = false
- arrow.Position = head.Position + Vector3.new(0,2,0)
- arrow.Orientation = beam.Orientation
- arrow.TopSurface = Enum.SurfaceType.Smooth
- arrow.BottomSurface = Enum.SurfaceType.Smooth
- arrow.FrontSurface = Enum.SurfaceType.Hinge
- arrow.BrickColor = BrickColor.new("Gold")
- end
- else
- folder:Destroy()
- repeat
- wait()
- until 1 == 2
- end
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment