
4.0k Views
24 Executions
Drawing dot new line module script
Universal Script 📌
asyran310810First script
2 years ago
Please login to perform these actions:Does it work?
No reports yetNo reports yet. Tried it? Be the first to say.
Also noticed:
Description
Replicates Drawing.new("Line") Purly with no unc reqiured needs to have Drawing:Update() do update drawing if you put new value
Updates
Script edited: Create script
local Drawing = {}
Drawing.__index = Drawing
function Drawing.new(type)
if type == "Line" then
local self = setmetatable({}, Drawing)
-- Create UI frame for the line
self.Instance = Instance.new("Frame")
self.Instance.AnchorPoint = Vector2.new(0.5, 0.5)
self.Instance.BorderSizePixel = 0
self.Instance.Parent = game.Players.LocalPlayer:WaitForChild("PlayerGui"):FindFirstChild("ScreenGui") or Instance.new("ScreenGui", game.Players.LocalPlayer:WaitForChild("PlayerGui"))
-- Default values
self.From = Vector2.new(0, 0)
self.To = Vector2.new(100, 100)
self.Thickness = 5
self.Color = Color3.new(1, 1, 1)
self.Visible = true
-- Apply initial properties
self:Update()
return self
else
error("Invalid Drawing type: " .. type)
end
end
function Drawing:Update()
if not self.Instance then return end
if not self.Visible then
self.Instance.Visible = false
return
end
local distance = (self.To - self.From).Magnitude
local direction = (self.To - self.From).Unit
local angle = math.deg(math.atan2(direction.Y, direction.X))









dtc