View difference between Paste ID: HrsLcj8f and L3ygPAJa
SHOW: | | - or go back to the newest paste.
1
--// Reciter
2
3-
local Host = game:service'Players'.Filipek8792
3+
local Host = game:service'Players'.ilovemen536
4
local Max, Up = 50,.2
5
local Y = .025
6
local Plots = {};
7
8
local Offset = Vector3.new(-Max/2,-1,100)
9
local Delay = .025
10
11
local background = Instance.new('Part')
12
background.Size = Vector3.new(Max, Max, Y)
13
background.Name = 'background'
14
background.Anchored = true
15
background.Transparency=0
16
background.Material = 'Grass'
17
background.CFrame = CFrame.new(Offset) * CFrame.new((Max/2)+1,(Max/2)+1,1.5+Y)
18
background.Color = Color3.new(.156863,.498039,.278431)
19
background.Parent = script
20
21
_G.Ignore = _G.Ignore or {};
22
23
table.insert(_G.Ignore, background)
24
25
function Affect(Function)
26
	for Index, Plot in next, Plots do
27
		Function(Plot)
28
	end
29
end
30
31
function Render()
32
	local yi,xi = 0, 0
33
	for y = 0, (Max + Up), Up do
34
		yi = yi + 1
35
		for x = 0, (Max + Up), Up do
36
			xi = xi + 1
37
			local Plot = Instance.new('Part')
38
			Plot.Size = Vector3.new(1,1,1)
39
			Plot.Name = 'Base'
40
			Plot.Anchored = true
41
			--Plot.Material = 'Neon'
42
			Plot.CFrame = CFrame.new(Up * xi, Up * yi, 1) * CFrame.new(Offset.X/2,Offset.Y,Offset.Z)
43
			Plot.Transparency = 0
44
			
45
			local Mesh = Instance.new('SpecialMesh')
46
			Mesh.MeshId='rbxassetid://9856898'
47
			Mesh.TextureId='rbxassetid://215418209'
48
			Mesh.Scale = Vector3.new(Up,Up,Y)
49
			
50
			Mesh.Parent = Plot
51
			
52
			Plots[#Plots + 1] = {Plot, Mesh, Plot:Clone()}
53
		end
54
		xi = 0
55
		wait(Delay)
56
	end
57
58
	print(#Plots)
59
end
60
61
function SendRay(Part)
62
	local Ting
63
	if type(Part) == 'Instance' and Part:IsA'BasePart' then
64
		Ting = Part.Position
65
	else
66
		Ting = Part
67
	end
68
	local Ray = Ray.new(Ting,Vector3.new(0,0,-1)*9e9)
69
	--table.insert(Ignore, Part)
70
	local Hit,Pos,SurfaceNorm = workspace:FindPartOnRayWithIgnoreList(Ray,_G.Ignore)
71
	if Hit == nil then return false,nil end
72
	return true, Hit
73
end;
74
75
local mn = 0
76
Host.Chatted:connect(function(msg)
77
	if msg:sub(1,8) == '!render ' then
78
		local num = msg:sub(9)
79
		if typeof(tonumber(num)):lower() ~= 'number' then
80
			return
81
		elseif tonumber(num) < .1 then
82
			--num = .5
83
			warn'too high of resolution'
84
			return
85
		end
86
		if Up ~= num then
87
			Up = num
88
			print('Rendering '..num)
89
			Render()
90
			print'Capturing'
91
		else
92
			print('Recapturing')
93
		end
94
		mn = 0
95
		local used = 0
96
		Affect(function(Plot)
97
			local Block, Mesh, OG = Plot[1], Plot[2], Plot[3]
98
			local hit, obj = SendRay(OG.Position)
99
			if hit ~= false and obj ~= nil then
100
				if obj.Parent:IsA'Accessory' or obj.Parent:IsA'Hat' or obj.Name == 'Wall' then
101
					table.insert(_G.Ignore, obj)
102
				else
103
					used = used + 1
104
					local cr,cg,cb = obj.Color.r,obj.Color.g,obj.Color.b
105
					local origin = Block.CFrame
106
					local refer = obj.CFrame
107
					local a,b = refer.p, origin.p
108
					local dist = (a-b).magnitude
109
					num = math.rad(dist)
110
					if num > mn then
111
						mn = num
112
					end
113
					local r,g,b = num,num,num
114
					Mesh.VertexColor = Vector3.new(cr-r,cg-g,cb-b)
115
					Block.Material = obj.Material
116
					Block.Transparency = 0
117
					Block.CanCollide = true
118
					Mesh.Scale = Mesh.Scale+Vector3.new(Mesh.Scale.X,Mesh.Scale.Y,0)
119
					delay((math.random()/(math.random()+.5)) , function()
120
						Block.Parent = script
121
					end)
122
					game:service'RunService'.Stepped:wait()
123
				end
124
			else
125
				Block.Parent = nil
126
			end
127
		end)
128
		print(used..' pixels out of '..#Plots..' used in rendering')
129
	end
130
end)