Dummiez
|
  |
| Joined: 07 Feb 2009 |
| Total Posts: 326 |
|
|
| 22 Feb 2014 03:44 PM |
This is probably one of those really dumb questions and like ohh so that's how you get it. How do you get individual position of GUIs?
gui = script.Parent
x = gui.Position.X y = gui.Position.Y
Or
gui = script.Parent
x = gui.Position.UDim2.X y = gui.Position.UDim2.Y |
|
|
| Report Abuse |
|
|
|
| 22 Feb 2014 03:49 PM |
Gui = script.Parent x = Gui.Position.X y = Gui.Position.Y print ("x ="x.." y ="..y")
--not sure |
|
|
| Report Abuse |
|
|
|
| 22 Feb 2014 03:51 PM |
| print(script.Parent.Position) |
|
|
| Report Abuse |
|
|
Dummiez
|
  |
| Joined: 07 Feb 2009 |
| Total Posts: 326 |
|
|
| 22 Feb 2014 03:53 PM |
| The first one gives me a Userdata value error, and I need the positions stored in a variable, not printed. |
|
|
| Report Abuse |
|
|
|
| 22 Feb 2014 03:55 PM |
| Idk I've done it before,but can't remeber how :/ |
|
|
| Report Abuse |
|
|
|
| 22 Feb 2014 03:58 PM |
| is the Gui variable a screengui, a frame, a textbutton.. what is it? |
|
|
| Report Abuse |
|
|
Dummiez
|
  |
| Joined: 07 Feb 2009 |
| Total Posts: 326 |
|
|
| 22 Feb 2014 04:00 PM |
Okay, so I get this error in the following script, being specific as much as possible.
Cause it says in the first line: attempt to compare number with userdata.
if main.Position.X >= 355 and main.Position.X <= 480 then if main.Parent.Position.Y >= 60 and main.Parent.Position.Y <= 185 then p = script.Parent.Parent:GetChildren() for i = 1, #p do if (p[i].Name == "MoveGround") then get = p[i]:Clone() get.Motions.Disabled = true get.Parent = script.Parent.Parent p[i]:Destroy() end end end end |
|
|
| Report Abuse |
|
|
KEVEKEV77
|
  |
| Joined: 12 Mar 2009 |
| Total Posts: 6961 |
|
|
| 22 Feb 2014 04:00 PM |
variablename = script.Parent.Position
OR to be more specific, make a bunch of variables...
a = Offset b = Scale c = script.Parent
lol = c.a lolz = c.b
|
|
|
| Report Abuse |
|
|
Dummiez
|
  |
| Joined: 07 Feb 2009 |
| Total Posts: 326 |
|
|
| 22 Feb 2014 04:01 PM |
| Also, main is the gui. Forgot to add that in. |
|
|
| Report Abuse |
|
|
Dummiez
|
  |
| Joined: 07 Feb 2009 |
| Total Posts: 326 |
|
|
| 22 Feb 2014 04:08 PM |
Thanks guys, just figured it out :P
gui = script.Parent
x = gui.Position.UDim2.X.Offset y = gui.Position.UDim2.Y.Offset |
|
|
| Report Abuse |
|
|
KEVEKEV77
|
  |
| Joined: 12 Mar 2009 |
| Total Posts: 6961 |
|
|
| 22 Feb 2014 04:09 PM |
| yeha, forgot to add that stuff in |
|
|
| Report Abuse |
|
|
|
| 22 Feb 2014 04:21 PM |
Righht,I forgot how to do that :) I usually work with parts And when I use UDim2.new,its usually for adding lol |
|
|
| Report Abuse |
|
|