"Wedge" GUI generator

Eyo,

About two years ago, I coded a script that’d create a “wedge” shaped GUI. Here’s the code (I edited it so it’d run slightly a bit faster), This is how it’d look: http://gyazo.com/2f216fdf8bfb27d680f477c8a9e26f80

NOTE: THIS is all GUI generated. So it’s not some image (even though, that’d be faster)

V Code

local Point = 1
–[[
What side do you want the point to be?
1: Point will be facing left and down
2: Point will be facing right and down
3: Point will be facing right and up
4: Point will be facing left and up

–]]
local Transparency = 0 – What transparency do you want to set the frames on?
local c3 = Color3.new
local UD2 = UDim2.new
local IN = Instance.new
local Color = c3(0,0,0)

local TotalFrames = 30 – How many frames do you want there to be created?

local function frame()

local sg = IN("ScreenGui",game.Workspace)
local MainFrame = IN("Frame",sg)
MainFrame.Size = UD2(0,TotalFrames,0,TotalFrames)
MainFrame.BackgroundTransparency = 1

for i = 0,TotalFrames do
	local frame = IN("Frame",MainFrame)
	frame.Name = "Frame"..i..""
	frame.BackgroundTransparency = Transparency
	frame.BackgroundColor3 = Color
	frame.BorderSizePixel = 0
	if Point == 1 then
		frame.Size = UD2(0,1,0,i)
		frame.Position = UD2(0,i,0,0)
	elseif Point == 2 then
		frame.Size = UD2(0,1,0,i)
		frame.Position = UD2(0,TotalFrames-i,0,0)
	elseif Point == 3 then
		frame.Size = UD2(0,1,0,i-TotalFrames)
		frame.Position = UD2(0,i,0,TotalFrames)
	elseif Point == 4 then
		frame.Size = UD2(0,1,0,i-TotalFrames)
		frame.Position = UD2(0,TotalFrames-i,0,TotalFrames)
	else
		return
	end	
end

end

frame()

Does it only create right triangles?

the code button doesn’t work but you can still type [ code] --code[ /code]

Thanks man! So simple… I can’t believe I overlooked it. This will be fun to screw around with.

By the way guys, if you want to create something other than a right triangle, here you go:

local frames = 200 -- how many frames there are, depending on the count of this is the size of the triangle
local face = 1 -- faces = 1, 2, 3, 4 (1 is N, 2 is S, 3 is W, 4 is E)
function createTriangle()
	local sg = Instance.new("ScreenGui",game.StarterGui)
	local mf = Instance.new("Frame",sg)
	mf.Size = UDim2.new(0,frames,0,frames)
	mf.BackgroundTransparency = 1
	for i = 0,frames do
		local pixel = Instance.new("Frame",mf)
		pixel.Name = "pixel"
		pixel.BackgroundColor3 = Color3.new(0,0,0)
		pixel.BorderSizePixel = 0
		if i < frames/2 then
			pixel.Size = UDim2.new(0,1,0,i)
			pixel.Position = UDim2.new(0,i,0,0)
		else
			pixel.Size = UDim2.new(0,1,0,frames-i)
			pixel.Position = UDim2.new(0,i,0,0)
		end
		game:GetService("RunService").RenderStepped:wait()
	end
	mf.Rotation = face == 1 and 180 or face == 2 and 0 or face == 3 and -90 or face == 4 and 90
end

createTriangle()

I got bored, so I took the idea of the Sound’s script and altered it a bit.

For right triangles, I just use a white triangle already uploaded, and to change the color, I change ImageColor3 and to change the transparency ImageTransparency.