Advertisement
Guest User

uber dab stuff

a guest
Dec 11th, 2018
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.55 KB | None | 0 0
  1. local player = game.Players.LocalPlayer
  2. local character = player.Character
  3. local mouse = player:GetMouse()
  4. local gui = player.PlayerGui.GUI
  5.  
  6. local from = Vector2.new(0,0)
  7. local line = Instance.new("Frame", gui)
  8.  
  9. mouse.Move:connect(function()
  10.     local to = Vector2.new(mouse.X, mouse.Y)
  11.     local vector = to-from
  12.     local angle = math.atan2(vector.Y, vector.X)
  13.     local distance = vector.magnitude
  14.     local half = distance/2
  15.     line.Size = UDim2.new(0,distance,0,1)
  16.     line.Position = UDim2.new(0, from.X + half*math.cos(angle), 0, from.Y + half*math.sin(angle))
  17. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement