Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- repeat wait() until game.Players.LocalPlayer.Character
- local NODE_SIZE = 1
- local player = game.Players.LocalPlayer
- local character = player.Character
- local nodes = script.Parent:WaitForChild("Nodes")
- local node = {}
- local deb = false
- function attr(objects, properties)
- objects = type(objects) == "table" and objects or {objects}
- for _, v in ipairs(objects) do
- for key, value in pairs(properties) do
- v[key] = value
- end
- end
- return unpack(objects)
- end
- function round(n, mult)
- return math.floor((n + mult/2)/mult) * mult
- end
- function findPosColor(position)
- local ray = Ray.new(Vector3.new(position.X, 100, position.Z), (position - Vector3.new(position.X, 100, position.Z)).unit * 500)
- local part = Workspace:FindPartOnRay(ray, character)
- if part then
- return Color3.new(part.BrickColor.Color.r, part.BrickColor.Color.g, part.BrickColor.Color.b)
- end
- return Color3.new(1, 1, 1)
- end
- for i = -75, 75, NODE_SIZE do
- node[i] = {}
- end
- for y = -75, 75, NODE_SIZE do
- for x = -75, 75, NODE_SIZE do
- node[x][y] = attr(Instance.new("Frame", nodes), {
- Size = UDim2.new(0, NODE_SIZE, 0, NODE_SIZE),
- Position = UDim2.new(0, x + 75, 0, y + 75),
- BorderSizePixel = 0,
- ZIndex = 3
- })
- end
- end
- local progress = attr(Instance.new("Frame", nodes), {
- Size = UDim2.new(0, 2, 0, 150),
- BackgroundColor3 = Color3.new(0.6, 1, 0.6),
- ZIndex = 4,
- })
- function scan()
- local ticks = 0
- local benchX, benchY = character.Torso.Position.X, character.Torso.Position.Z
- for x = -75, 75, NODE_SIZE do
- ticks = ticks + 1
- if ticks % 2 == 0 then
- wait()
- end
- progress.Position = UDim2.new(0, x + 75, 0, 0)
- for y = -75, 75, NODE_SIZE do
- node[x][y].BackgroundColor3 = findPosColor(Vector3.new(round(benchX, NODE_SIZE) + (x + (NODE_SIZE / 2)), -10, round(benchY, NODE_SIZE) + (y + (NODE_SIZE / 2))))
- end
- end
- scan()
- end
- scan()
Advertisement
Add Comment
Please, Sign In to add comment