Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- game.StarterGui:SetCoreGuiEnabled("All", false)
- local cx = 692 / 2
- local cy = 449 / 2
- local bx = 692
- local by = 449
- local sqrt, deg, acos, pow, abs = math.sqrt, math.deg, math.acos, math.pow, math.abs
- local distance = function(point1, point2)
- return abs(sqrt(pow(point2.Y - point1.Y, 2) + pow(point2.X - point1.X, 2)))
- end
- local angle = function(point1, point2)
- return abs(deg(acos((point2.X - point1.X) / (distance(point1, point2)))))
- end
- local seg = function(x1, y1, x2, y2)
- local point1, point2 = Vector2.new(x1, y1), Vector2.new(x2, y2)
- local new = Instance.new("TextLabel", script.Parent)
- new.Text = ""
- new.Size = UDim2.new(0, distance(point1, point2), 0, 1)
- new.Position = UDim2.new(0, (point1 + (((point2 - point1).unit) * (distance(point1, point2) / 2))).X - new.Size.X.Offset/2, 0, point1.Y + ((point2.Y - point1.Y) / 2))
- new.Rotation = angle(point1, point2)
- new.BorderSizePixel = 0
- new.BackgroundColor3 = Color3.new(1, 0, 0)
- return {
- angle = new.Rotation,
- length = new.Size.X.Offset,
- dest = function()
- new:Destroy()
- end
- }
- end
- seg(50, 50, 250, 250)
Advertisement
Add Comment
Please, Sign In to add comment