generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: making a button so it can be dragged and dropped

Previous Thread :: Next Thread 
COW135COW is not online. 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 is not online. 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 is not online. 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 is not online. kingmatt2
Joined: 20 Aug 2011
Total Posts: 6494
19 Feb 2014 09:13 PM
Ad and


end


After the wait()
Report Abuse
Crazy010517 is not online. Crazy010517
Joined: 17 Sep 2011
Total Posts: 1161
19 Feb 2014 09:47 PM
I think by button, he means a brick .-.
Report Abuse
kingmatt2 is not online. kingmatt2
Joined: 20 Aug 2011
Total Posts: 6494
19 Feb 2014 09:48 PM
He just said "In a plugin"
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image