|
| 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 |
|
|
|
| 28 Jun 2014 06:34 PM |
| Lol isn't there a draggable property? |
|
|
| Report Abuse |
|
|
| |
|
|
| 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 |
|
|
|
| 28 Jun 2014 06:38 PM |
| Just make it draggable when the user hovers their mouse above it. Not that hard, really. |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
| |
|
|
| 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 |
|
|
| |
|