COW135COW
|
  |
| Joined: 30 Jan 2014 |
| Total Posts: 82 |
|
|
| 19 Feb 2014 08:58 PM |
| Hi i am making a plugin and i added a button and how can i make it so you can drag and drop that button with the mouse? P.S I'm new to making plugins |
|
|
| Report Abuse |
|
|
kingmatt2
|
  |
| Joined: 20 Aug 2011 |
| Total Posts: 6494 |
|
|
| 19 Feb 2014 09:05 PM |
On the click function for a GUI the two varibals for it at the X and Y or the mouse.
script.Parent.Button1Down:connect(function(X,Y) script.Parent.Position = udim2.new(0,X,0,X) end)
You may need to look it up in the wiki. Button1Down might be incorrect as-well as udim2.
|
|
|
| Report Abuse |
|
|
kingmatt2
|
  |
| Joined: 20 Aug 2011 |
| Total Posts: 6494 |
|
|
| 19 Feb 2014 09:11 PM |
MainScreen.MouseButton1Down:connect(function(x,y) clicked = true while clicked do MainSceen.Position = UDim2.new(0,x,0,y) wait() end) MainScreen.MouseButton1Up:connect(function(x,y) clicked = false end)
Or
MainScreen.MouseButton1Down:connect(function(x,y) clicked = true while clicked do MainSceen.Position = UDim2.new(0,x,0,y) wait() MainScreen.MouseButton1Up:connect(function(x,y) clicked = false end) end)
One might work one might not.
|
|
|
| Report Abuse |
|
|
kingmatt2
|
  |
| Joined: 20 Aug 2011 |
| Total Posts: 6494 |
|
|
| 19 Feb 2014 09:13 PM |
Ad and
end
After the wait() |
|
|
| Report Abuse |
|
|
|
| 19 Feb 2014 09:47 PM |
| I think by button, he means a brick .-. |
|
|
| Report Abuse |
|
|
kingmatt2
|
  |
| Joined: 20 Aug 2011 |
| Total Posts: 6494 |
|
|
| 19 Feb 2014 09:48 PM |
| He just said "In a plugin" |
|
|
| Report Abuse |
|
|