Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local folder = Instance.new("WorldModel",script)
- local sc = 0
- function swait(t)
- sc = sc + 1
- if sc >= t then
- sc = 0
- game:GetService("RunService").Heartbeat:Wait()
- end
- end
- function donut(s)
- local r = s/2
- local l = 100 + s*10
- local center = CFrame.new(0,s*2,-50)
- for i = 1,l do
- local x2 = r*math.cos(i*l/r)
- local y2 = r*math.sin(i*l/r)
- local scale = s/((s-s/4)-math.cos(2*i))
- local z2 = math.sin(x2-y2)+math.cos(x2+y2)+math.cos(x2/y2)
- local xy = CFrame.new(x2,y2,0)
- local part = Instance.new("Part")
- part.Color = Color3.fromHSV(math.abs(x2),255,255)
- part.Size = Vector3.new(1,1,1)
- part.CFrame = xy*center
- part.Anchored = true
- part.Parent = folder
- end
- end
- function infinity(s)
- game:GetService("RunService").Stepped:Connect(function(t)
- local center = CFrame.new(0,s*2,-50)
- local scale = s/((s-s/4)-math.cos(2*t))
- local x = scale*math.cos(t)
- local y = scale*math.sin(2*t)/2
- local z = scale*math.sin(2/t)*2
- local x2 = ((x+1)*s)
- local y2 = ((y-1)*s)
- local z2 = (x2+y2)
- local xy = CFrame.new(x2,y2,0)
- local part = Instance.new("Part")
- part.Material = Enum.Material.Neon
- part.Color = Color3.fromHSV(math.abs(x),255,255)
- part.Size = Vector3.new(1,1,1)
- part.CFrame = xy*center
- part.Anchored = true
- part.Parent = folder
- end)
- end
- function infinity2(s)
- local part = Instance.new("Part")
- part.Material = Enum.Material.Neon
- part.Size = Vector3.new(1,1,1)
- part.Anchored = true
- part.Parent = folder
- local att1,att2 = Instance.new("Attachment"),Instance.new("Attachment")
- att1.Position = Vector3.new(0,-0.5,0)
- att2.Position = Vector3.new(0,0.5,0)
- att1.Parent = part
- att2.Parent = part
- local trail = Instance.new("Trail")
- trail.Parent = part
- trail.Attachment0 = att1
- trail.Attachment1 = att2
- trail.FaceCamera = true
- trail.LightInfluence = 1
- trail.Transparency = NumberSequence.new(0,1)
- trail.MinLength = 0
- trail.Lifetime = 10
- game:GetService("RunService").Heartbeat:Connect(function(t)
- local center = CFrame.new(0,s*2,-50)
- local scale = s/((s-s/4)-math.cos(2*t))
- local x = scale*math.cos(t)
- local y = scale*math.sin(2*t)/2
- local z = scale*math.sin(2/t)*2
- local x2 = ((x+1)*s)
- local y2 = ((y-1)*s)
- local z2 = (x2+y2)
- local xy = CFrame.new(x2,y2,0)
- game:GetService("TweenService"):Create(part,TweenInfo.new(1),{CFrame = xy*center}):Play()
- trail.Color = ColorSequence.new(Color3.fromHSV(math.abs(x),255,255))
- end)
- end
- local sc = 0
- function swait(t)
- sc = sc + 1
- if sc >= t then
- sc = 0
- game:GetService("RunService").Heartbeat:Wait()
- end
- end
- function mandelbrot(s)
- local width = s
- local height, wscale = width, 2/width
- local m, limit2 = 100, 16
- local iter = 0
- local center = CFrame.new(0,0,-50)
- local div = 10
- local size = width/height/div
- local i = 0
- local pf = Instance.new("Folder",script)
- local pt = {}
- local colors = {}
- for n = 1,m do
- local hu = math.sqrt(n/m)
- colors[n] = Color3.fromHSV(hu, 255, 150)
- end
- local function render()
- i = i + 1
- for y = 1,height do
- for x = 1,width do
- local a = x * wscale - 1.5
- local b = 2*y / height - 1
- local ca = a
- local cb = b
- local n = 0
- local sin = 1 -- math.sin(i/10)
- while (n < m) do
- local aa = a * a - b * b
- local bb = 2 * a * b
- a = aa + ca * sin
- b = bb + cb
- if (a * a + b * b > limit2) then
- break
- end
- n = n + 1
- end
- local bright = math.sqrt((n*limit2)%255)
- local color = colors[n]
- --color = Color3.new(bright,bright,bright)
- if (n == m) then
- bright = 0
- color = Color3.new()
- end
- local tp = ((y-1)*(width*1))+x
- local vs = Vector3.new(size,size,size*(bright*2))
- vs = Vector3.new(size,size,size)
- if 1 >= i then
- local f = Instance.new('Part')
- f.Material = Enum.Material.SmoothPlastic
- f.Massless = true
- f.Anchored = true
- f.CanCollide = false
- f.CastShadow = false
- f.Color = color
- f.Size = Vector3.new(1, 1, 1)
- local mesh = Instance.new("BlockMesh")
- mesh.Scale = vs
- mesh.Parent = f
- f.CFrame = center*CFrame.new(x*size,y*size,0)
- f.Parent = pf
- pt[tp] = f
- else
- pt[tp].Color = color
- if pt[tp]:FindFirstChildOfClass("BlockMesh") then
- pt[tp]:FindFirstChildOfClass("BlockMesh").Scale = vs
- end
- end
- swait(500)
- end
- end
- end
- spawn(function()
- while wait(0) do
- render()
- end
- end)
- end
- function tree(bl)
- local center = CFrame.new(0,bl/2,-50)
- local base = Instance.new("Part")
- base.Material = Enum.Material.SmoothPlastic
- base.Color = Color3.new(1,0,0)
- base.Size = Vector3.new()
- base.CFrame = center
- base.CastShadow = false
- base.Massless = true
- base.Anchored = true
- base.CanCollide = false
- base.Parent = folder
- local branches = {base}
- local function make_part(r)
- local p = base:Clone()
- p.Color = Color3.new(1-(r/bl),0,0)
- p.Parent = folder
- return p
- end
- local function connect(p1,p2,r)
- local a1 = Instance.new("Attachment",p1)
- local a2 = Instance.new("Attachment",p2)
- local bar = Instance.new("RodConstraint")
- bar.Attachment0 = a1
- bar.Attachment1 = a2
- bar.Color = BrickColor.new(Color3.new(1-(r/bl),0,0))
- bar.Parent = p1
- bar.Visible = true
- end
- local function extend(t, branch_length, shorten_by, angle, r)
- local new_length = 0
- local min_length = 5
- local div = 10
- if branch_length > min_length then
- local new = {}
- for i,v in pairs(t) do
- local up = make_part(r)
- up.CFrame = v.CFrame*CFrame.new(0,branch_length/div,0) -- up
- local left = make_part(r)
- left.CFrame = up.CFrame*CFrame.Angles(0,0,math.rad(angle))*CFrame.new(0,branch_length/div,0) -- left
- local right = make_part(r)
- right.CFrame = up.CFrame*CFrame.Angles(0,0,-math.rad(angle))*CFrame.new(0,branch_length/div,0) -- right
- connect(up,v,r)
- connect(left,up,r)
- connect(right,up,r)
- table.insert(new,1,left)
- table.insert(new,1,right)
- swait(100)
- end
- new_length = branch_length - shorten_by
- r = r + shorten_by
- extend(new, new_length, shorten_by, angle, r)
- end
- end
- extend(branches, bl, 5, 30, 1)
- end
- function pi(s)
- local Part0 = Instance.new("Part")
- local SurfaceGui1 = Instance.new("SurfaceGui")
- local TextLabel2 = Instance.new("TextBox")
- Part0.Parent = folder
- Part0.CFrame = CFrame.new(2.6149931, 8.83000565, -12.8999939, -1, 0, 0, 0, 1, 0, 0, 0, -1)
- Part0.Orientation = Vector3.new(0, 180, 0)
- Part0.Position = Vector3.new(2.6149931, 8.83000565, -20)
- Part0.Rotation = Vector3.new(-180, 0, -180)
- Part0.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
- Part0.Size = Vector3.new(19.2099972, 5.33999777, 2)
- Part0.Anchored = true
- Part0.BottomSurface = Enum.SurfaceType.Smooth
- Part0.BrickColor = BrickColor.new("Really black")
- Part0.CanCollide = false
- Part0.Material = Enum.Material.SmoothPlastic
- Part0.TopSurface = Enum.SurfaceType.Smooth
- Part0.brickColor = BrickColor.new("Really black")
- SurfaceGui1.Parent = Part0
- SurfaceGui1.CanvasSize = Vector2.new(400, 60)
- TextLabel2.Parent = SurfaceGui1
- TextLabel2.Size = UDim2.new(1, 0, 1, 0)
- TextLabel2.BackgroundColor = BrickColor.new("Institutional white")
- TextLabel2.BackgroundColor3 = Color3.new(1, 1, 1)
- TextLabel2.BackgroundTransparency = 1
- TextLabel2.BorderSizePixel = 0
- TextLabel2.Font = Enum.Font.SourceSansBold
- TextLabel2.FontSize = Enum.FontSize.Size36
- TextLabel2.Text = "Retreiving data.."
- TextLabel2.TextColor = BrickColor.new("Institutional white")
- TextLabel2.TextColor3 = Color3.new(1, 1, 1)
- TextLabel2.TextScaled = true
- TextLabel2.TextSize = 36
- TextLabel2.TextStrokeTransparency = 0
- TextLabel2.TextWrap = true
- TextLabel2.TextWrapped = true
- local text = TextLabel2
- wait()
- local n = 0
- local bs = s
- local start = 1
- local add = true
- game:GetService("RunService").Heartbeat:Connect(function()
- for i = start,s do
- i = (i*2)-1
- if add then
- n = n + 1/i
- else
- n = n - 1/i
- end
- add = not add
- end
- start = s
- s = s + bs
- text.Text = tostring(n*4) -- pi is 1/4 using this method
- end)
- end
- function triangle(s)
- local width = s
- local height = s
- local center = CFrame.new(0,0,-50)
- local div = 10
- local size = width/height/div
- local i = 0
- local pf = Instance.new("Folder",script)
- local pt = {}
- local function render()
- i = i + 1
- local m = {}
- m[math.floor(width/2)] = true
- for y = height, 1, -1 do
- local n = {}
- for x = 1, width do
- local color = Color3.new()
- if m[x] then
- color = Color3.new(1,1,1)
- n[x+1] = not n[x+1]
- n[x-1] = not n[x-1]
- end
- local tp = ((y-1)*(width*1))+x
- if 1 >= i then
- local f = Instance.new('Part')
- f.Material = Enum.Material.SmoothPlastic
- f.Massless = true
- f.Anchored = true
- f.CanCollide = false
- f.CastShadow = false
- f.Color = color
- f.Size = Vector3.new(1, 1, 1)
- local mesh = Instance.new("BlockMesh")
- mesh.Scale = Vector3.new(size,size,size)
- mesh.Parent = f
- f.CFrame = center*CFrame.new(x*size,y*size,0)
- f.Parent = pf
- pt[tp] = f
- else
- pt[tp].Color = color
- end
- swait(50)
- end
- m = n
- end
- end
- while true do
- render()
- end
- end
- local plr = owner -- sandbox value
- plr.Chatted:Connect(function(msg)
- if msg:lower():sub(1,5) == 'inf2/' then
- local s = msg:sub(6)
- if tonumber(s) then
- infinity2(tonumber(s))
- end
- elseif msg:lower():sub(1,4) == 'inf/' then
- local s = msg:sub(5)
- if tonumber(s) then
- infinity(tonumber(s))
- end
- elseif msg:lower():sub(1,6) == 'donut/' then
- local s = msg:sub(7)
- if tonumber(s) then
- donut(tonumber(s))
- end
- elseif msg:lower():sub(1,5) == 'tree/' then
- local s = msg:sub(6)
- if tonumber(s) then
- tree(tonumber(s))
- end
- elseif msg:lower():sub(1,8) == 'fractal/' then
- local s = msg:sub(9)
- if tonumber(s) then
- mandelbrot(tonumber(s))
- end
- elseif msg:lower():sub(1,3) == 'pi/' then
- local s = msg:sub(4)
- if tonumber(s) then
- pi(tonumber(s))
- end
- elseif msg:lower():sub(1,9) == 'triangle/' then
- local s = msg:sub(10)
- if tonumber(s) then
- triangle(tonumber(s))
- end
- end
- end)
Add Comment
Please, Sign In to add comment