Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- assert(rconsoleinfo, 'exploit not supported')
- assert(Drawing, 'exploit not supported')
- if _G.DrawUI then
- return _G.DrawUI
- end
- local player = game:GetService("Players").LocalPlayer
- local mouse = player:GetMouse()
- local UserInputService = game:GetService("UserInputService")
- local DrawUI = {
- mouse_down = false,
- drawinglist = {},
- mouse_down_funcs = {}
- }
- function DrawUI:Count_Newline(str)
- local lines = 1
- for i = 1, #str do
- local c = str:sub(i, i)
- if c == '\n' then
- lines = lines + 1
- end
- end
- return lines
- end
- function DrawUI:Bind_Func_to_MouseDown(drawingobject,func)
- DrawUI.mouse_down_funcs[drawingobject] = func
- end
- function DrawUI:MakeDraggable(drawingobject)
- DrawUI.mouse_down_funcs[drawingobject] = (function(drawingobject)
- local drawingobject = drawingobject
- local MouseLocation = GetMouseLocation()
- local delta = drawingobject.Position - MouseLocation
- while DrawUI.mouse_down do
- game:GetService("RunService").RenderStepped:Wait()
- drawingobject.Position = GetMouseLocation() + delta
- end
- end)
- end
- mouse.Button1Down:Connect(function()
- DrawUI.mouse_down = true
- for drawingobject,func in pairs(DrawUI.mouse_down_funcs) do
- if IsMouseOverDrawing(drawingobject) and drawingobject.Visible then
- func(drawingobject)
- end
- end
- end)
- mouse.Button1Up:Connect(function()
- DrawUI.mouse_down = false
- end)
- function DrawUI:synTextLabel()
- local drawingobject = Drawing.new("Text")
- DrawUI.drawinglist[#DrawUI.drawinglist+1] = drawingobject
- drawingobject.Text = "Place"
- drawingobject.Size = 24
- drawingobject.Center = false
- drawingobject.Outline = true
- drawingobject.Color = Color3.new(255/255, 0/255, 0/255)
- drawingobject.OutlineColor = Color3.new(0, 0, 0)
- return drawingobject
- end
- function DrawUI:synTextButton()
- local drawingobject = Drawing.new("Square")
- local text = synTextLabel()
- DrawUI.drawinglist[#DrawUI.drawinglist+1] = drawingobject
- drawingobject.Size = Vector2.new(200,100)
- drawingobject.Color = Color3.new(.75, .75, .75)
- drawingobject.Filled = true
- spawn(function()
- while true do
- wait()
- text.Center = true
- text.Position = Vector2.new((drawingobject.Position.X+drawingobject.Size.X/2)-text.Text:len()/2 ,(drawingobject.Position.Y + drawingobject.Size.Y/2)-text.Size/2)
- game:GetService("RunService").RenderStepped:Wait()
- end
- end)
- return drawingobject ,text
- end
- function GetMouseLocation()
- return UserInputService:GetMouseLocation();
- end
- function IsMouseOverDrawing(Drawing, MousePosition)
- local TopLeft = Drawing.Position;
- local BottomRight
- if Drawing.Text then
- BottomRight = Vector2.new(Drawing.Position.X + #Drawing.Text, Drawing.Position.Y+(DrawUI:Count_Newline(Drawing.Text)*Drawing.Size))
- else
- BottomRight = Drawing.Position + Drawing.Size;
- end
- local MousePosition = MousePosition or GetMouseLocation();
- return MousePosition.X > TopLeft.X and MousePosition.Y > TopLeft.Y and MousePosition.X < BottomRight.X and MousePosition.Y < BottomRight.Y;
- end
- _G.DrawUI = DrawUI
- return DrawUI
Add Comment
Please, Sign In to add comment