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! |