Ever wanted a way to make shapes? well I got you covered
here is a small script I wrote to generate a shape of your choice
local points = 3
local startpoint = Vector3.new(0,0,0)
local r = 30
local prevpart = nil
local firstpart = nil
local cf = CFrame.new(startpoint)
local tempfolder = Instance.new("Folder")
local function makepoint()
local part = Instance.new("Part",tempfolder)
part.Size = Vector3.new(0.1,2,0.1)
part.Material = Enum.Material.SmoothPlastic
part.Anchored = true
return part
end
for i=1,points do
local part = makepoint()
local pos = cf*CFrame.Angles(0,math.rad((360/points)*i),0)*CFrame.new(0,0,r)
part.Position = pos.Position
if prevpart ~= nil then
local path = part:Clone()
path.Parent = workspace
path.CFrame = CFrame.new(prevpart.Position:Lerp(part.Position,0.5),prevpart.Position)
path.Size = Vector3.new(0.1,2,(prevpart.Position-part.Position).Magnitude)
end
if firstpart == nil then
firstpart = part
end
prevpart = part
end
local path = firstpart:Clone()
path.Parent = workspace
path.CFrame = CFrame.new(prevpart.Position:Lerp(firstpart.Position,0.5),prevpart.Position)
path.Size = Vector3.new(0.1,2,(prevpart.Position-firstpart.Position).Magnitude)
tempfolder:Destroy()
follow these steps to set it up
Steps
put the script in workspace
replace the first 3 variables with what you desire
local points = 3 -- number of verticies aka 3 makes a triangle
local startpoint = Vector3.new(0,0,0) -- position
local r = 3 -- radius
and then click play!
this is what a triangle came out:
copy the build and paste in studio (no play mode)
then use gapfill to do as followed
and voila ur triangle is done
Hope this was useful
Like?
0 voters