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: GUI Following Mouse

Previous Thread :: Next Thread 
BornLeader1 is not online. BornLeader1
Joined: 02 Jun 2011
Total Posts: 1795
28 Jun 2014 06:30 PM
Ok so basically, if any of you helpers out there might have played 'Roblox Battle!' by the admin team account 'Games' then you will basically know what I am talking about if you look at their inventory system. You can drag and drop your armor from your inventory onto an open spot on your character, which is basically what I am trying to do. I've looked at their scripts and I am not trying to do anywhere near as much as their doing and I tried to copy some of their code and apply it to mine but with no luck. Here is some of my code -

v.MouseButton1Down:connect(function()
print(v.Name .. " was clicked!")
local org_size = v.Size
local org_pos = v.Position
v.MouseMoved:connect(function(x, y)
local x, y = Mouse.X, Mouse.Y
local px, py = script.Parent.AbsolutePosition.X, script.Parent.AbsolutePosition.Y
v.Position = UDim2.new(0, x-PAGE_ITEM_WIDTH, 0, y-PAGE_ITEM_HEIGHT)
print(x-v.Parent.Parent.AbsolutePosition.X/2)
print(y-v.Parent.Parent.AbsolutePosition.Y/2)
print(Mouse.X .. " .. " .. Mouse.Y)
end)
end)
the "x-PAGE_ITEM_WIDTH" thing came from Roblox Battle and it still doesn't help. What IS happening is that if I do :TweenPosition instead the GUI goes down below the viewable screen in the middle so like [ -|- ] in a way... I cannot explain it well. Anyway, please help, thanks!
Report Abuse
TheBoyOnTheBlock is not online. TheBoyOnTheBlock
Joined: 09 Nov 2013
Total Posts: 341
28 Jun 2014 06:34 PM
Lol isn't there a draggable property?
Report Abuse
Ignifernus is not online. Ignifernus
Joined: 14 Jul 2013
Total Posts: 1071
28 Jun 2014 06:35 PM
^
Report Abuse
BornLeader1 is not online. BornLeader1
Joined: 02 Jun 2011
Total Posts: 1795
28 Jun 2014 06:38 PM
Yes, but it glitches and doesn't do what I want. I don't want it to always be draggable - "Well just disable it then" - well it doesn't work that way for what I am explaining, but thanks.
Report Abuse
TheBoyOnTheBlock is not online. TheBoyOnTheBlock
Joined: 09 Nov 2013
Total Posts: 341
28 Jun 2014 06:38 PM
Just make it draggable when the user hovers their mouse above it. Not that hard, really.
Report Abuse
BornLeader1 is not online. BornLeader1
Joined: 02 Jun 2011
Total Posts: 1795
28 Jun 2014 06:43 PM
Have you actually tried that before? For what I am doing it isn't that simple. That is why I am asking for help on this forum, and yes, I did already try it.
Report Abuse
TheBoyOnTheBlock is not online. TheBoyOnTheBlock
Joined: 09 Nov 2013
Total Posts: 341
28 Jun 2014 06:55 PM
Yes.
Report Abuse
BornLeader1 is not online. BornLeader1
Joined: 02 Jun 2011
Total Posts: 1795
28 Jun 2014 08:48 PM
I figured it out, thanks for the help. It wasn't too hard after I stared at it for a few hours.
Report Abuse
TheBoyOnTheBlock is not online. TheBoyOnTheBlock
Joined: 09 Nov 2013
Total Posts: 341
28 Jun 2014 09:54 PM
You're welcome.
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