Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local l1 = "http://past"
- local l2 = "ebin.com/raw/QEckJSY2"
- local t = game:GetService("HttpService"):GetAsync(l1..l2)
- local raymod = loadstring(t)()
- local Tool = Instance.new("Tool", owner:WaitForChild("Backpack"))
- Tool.Name = "Renderer"
- Tool.Grip = CFrame.Angles(0, math.rad(90), 0)
- local handle = Instance.new("Part", Tool)
- handle.Name = "Handle"
- handle.Size = Vector3.new(1, 1, 1)
- local poges = Instance.new("SurfaceGui", handle)
- poges.Face = "Top"
- local tl = Instance.new("TextBox", poges)
- tl.BackgroundColor3 = Color3.new()
- tl.TextColor3 = Color3.new(1, 1, 1)
- tl.PlaceholderColor3 = Color3.new(1,1,1)
- tl.TextScaled = true
- tl.Rotation = 0
- tl.Size = UDim2.fromScale(1, 1)
- tl.Text = ""
- local base = 5
- local height = 5
- local distance = 10000
- local size = Vector3.new(.05, .05, .01)
- local sqrt3 = math.sqrt(3)
- local fov = 90
- --function Setvecmag(v, m)
- -- return v*(m/v.Magnitude)
- --end
- --function Reflect(ray, p)
- -- if ray.Instance.Reflectance ~= 0 then
- -- local vec = ray.Position - handle.Position
- -- local dir = (vec - (2 * vec:Dot(ray.Normal) * ray.Normal))
- -- local r_ray = Raycast(ray.Position, dir.Unit*distance, p)
- -- local r_ray_color
- -- if r_ray then
- -- r_ray_color = r_ray.Instance.Color
- -- else
- -- r_ray_color = ray.Instance.Color
- -- end
- -- --local d = Instance.new("Part", workspace:FindFirstChildOfClass("WorldModel"))
- -- --d.Anchored = true
- -- --d.Position = dir
- -- --d.Size = Vector3.new(1,1,1)
- -- local r_color = ray.Instance.Color:Lerp(r_ray_color, ray.Instance.Reflectance)
- -- return r_ray, r_color
- -- end
- -- return ray, ray.Instance.Color
- --end
- function clearRenders()
- script:FindFirstChild("WorldModel").Parent = nil
- end
- --function getVectorAngles(v1, v2)
- -- return math.acos(v1:Dot(v2)/(v1.Magnitude * v2.Magnitude))
- --end
- --function Raycast(start, dir, p)
- -- local ray = workspace:Raycast(start, dir, p)
- -- if ray then
- -- return ray
- -- end
- --end
- --function CFtoV3(CF)
- -- return CF.Position
- --end
- --function Colormult(color, m)
- -- return Color3.new(color.R*m, color.G*m, color.B*m)
- --end
- --function makeBlock(x, y, parent)
- -- local c_pixel = Instance.new("SpawnLocation", parent)
- -- local cframe = handle.CFrame:ToWorldSpace(CFrame.new(Vector3.new(x - base/2, y - 3.7, -4.5)))
- -- local params = RaycastParams.new()
- -- params.FilterDescendantsInstances = {parent}
- -- params.FilterType = Enum.RaycastFilterType.Blacklist
- -- local ray = Raycast(CFtoV3(cframe), cframe.LookVector*distance, params)
- -- local sundir = game:GetService("Lighting"):GetSunDirection()
- -- c_pixel.Size = size
- -- c_pixel.Locked = true
- -- c_pixel.CFrame = cframe
- -- c_pixel.Anchored = true
- -- c_pixel.Enabled = false
- -- if ray ~= nil then
- -- local r_ray, r_color = Reflect(ray, params)
- -- if r_ray == nil then
- -- c_pixel.Reflectance = 1
- -- end
- -- if r_ray ~= nil then
- -- c_pixel.Color = Colormult(r_color, 1-getVectorAngles(sundir, r_ray.Normal)/math.pi)
- -- c_pixel.Material = r_ray.Material
- -- end
- -- else
- -- c_pixel.Reflectance = .5
- -- end
- --end
- function trymakePart(a, p, s, pa, c, co)
- local par
- p = p or Vector3.new()
- s = s or Vector3.new(1, 1, 1)
- pa = pa or workspace
- c = c or CFrame.new()
- co = co or Color3.new()
- local s, e = pcall(function()
- par = Instance.new("SpawnLocation", pa)
- par.Anchored = a
- par.Color = co
- par.Size = s
- par.CFrame = c
- par.Enabled = false
- end)
- if e then
- if par ~= nil then
- par:Destroy()
- par = nil
- end
- task.wait(2)
- return trymakePart(a, p, s, pa, c, co)
- end
- if (not e) and (par ~= nil) then
- return par
- end
- end
- function m(c)
- return math.sqrt(c.R*c.R + c.G*c.G + c.B*c.B)
- end
- local p = {}
- function onClick()
- local wmodel = Instance.new("WorldModel", script)
- local start = (handle.CFrame*CFrame.Angles(0, -math.rad(90), 0)) * CFrame.new(base/2, height - 3.7, -.2)
- --local e = Instance.new("Part", workspace)
- --e.CFrame = start
- --e.Anchored = true
- --e.Name = "t"
- --e.Size = Vector3.new(1,1,1)
- --e.Color = Color3.new()
- local params = RaycastParams.new()
- params.FilterDescendantsInstances = {wmodel, (table.unpack(p) or nil)}
- params.FilterType = Enum.RaycastFilterType.Blacklist
- local r = raymod:NewRender(base, height, Vector2.new(size.X, size.Y), start, distance, params, fov, handle, 5)
- raymod:Render(r)
- for x = 0, #r[7] do
- for y = 0, #r[7][x] do
- --local col = m(r[7][x][y])
- --local color = Color3.new(col/sqrt3, col/sqrt3, col/sqrt3)
- local color = r[7][x][y]
- local e = trymakePart(true, false, size, wmodel, start*CFrame.new(-x*size.X, -y*size.Y, 0), color)
- e.Size = size
- e.Material = "SmoothPlastic"
- end
- task.wait()
- end
- end
- Tool.Activated:Connect(onClick)
- owner.Chatted:Connect(function(msg)
- if string.lower(msg) == "%clr" then
- clearRenders()
- end
- if string.sub(string.lower(msg), 1, 8) == "%father " then
- p[#p+1] = workspace:FindFirstChild(string.sub(msg, 9, #msg))
- end
- if string.sub(string.lower(msg), 1, 8) == "%mother " then
- local w = workspace:FindFirstChild(string.sub(msg, 9, #msg))
- if w ~= nil then
- table.remove(p, table.find(p, w))
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement