TheRealEprent

Lua (ROBLOX) drawing script

Feb 15th, 2015
828
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.56 KB | None | 0 0
  1. player=game.Players.LocalPlayer
  2.     mouse=player:GetMouse()
  3. size=UDim2.new(0,50,0,50)
  4. active=false
  5. function createpixel(x,y)
  6.     local pixel = Instance.new('Frame')
  7.         pixel.Size=size
  8.         pixel.Position=UDim2.new(0,x-(pixel.Size.X.Offset/2),0,y-(pixel.Size.Y.Offset/2))
  9.         pixel.Parent=script.Parent
  10.         pixel.BackgroundColor3=BrickColor.new('Cyan').Color
  11.         pixel.BorderSizePixel = 0
  12. end
  13.  
  14. mouse.Button1Down:connect(function()
  15.     active=true
  16.     repeat wait()   createpixel(mouse.X,mouse.Y) until active==false
  17. end)
  18.  
  19. mouse.Button1Up:connect(function()
  20.     active = false
  21. end)
Advertisement
Add Comment
Please, Sign In to add comment