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 » Scripters
Home Search
 

Re: If statement with UDim2

Previous Thread :: Next Thread 
Mintacle is not online. Mintacle
Joined: 28 Aug 2013
Total Posts: 498
15 Nov 2015 03:25 PM
Simply how do I use an if statement when using a gui's postion. I've done something like this which is incorrect:

if gui.Position == UDim2(0.3,0,0.3,0)

end


could someone help with this hopefully simple fix?
Report Abuse
PapiPaps is not online. PapiPaps
Joined: 26 Jun 2015
Total Posts: 19
15 Nov 2015 03:29 PM
if gui.Position == UDim2(0.3,0,0.3,0) then

end
Report Abuse
RonDanino is not online. RonDanino
Joined: 21 Dec 2012
Total Posts: 290
15 Nov 2015 03:30 PM
if gui.Position == UDim2(0.3,0,0.3,0) then
-- scriptscriptscript
end
Report Abuse
Zaxerion is not online. Zaxerion
Joined: 09 Feb 2013
Total Posts: 2304
15 Nov 2015 03:32 PM
Lmao, nobody knows of UDim2.new() here, do they.
Report Abuse
XIPokezIX is not online. XIPokezIX
Joined: 24 Sep 2015
Total Posts: 381
15 Nov 2015 03:33 PM
^ "new" *cough*
Report Abuse
RonDanino is not online. RonDanino
Joined: 21 Dec 2012
Total Posts: 290
15 Nov 2015 03:34 PM
@Zaxerion

He's not trying to create a new UDim2.
He's trying to do something when the UDim is in that certian position.
Report Abuse
isaacsoccer is not online. isaacsoccer
Joined: 22 Jul 2010
Total Posts: 430
15 Nov 2015 03:40 PM
If the GUI is like this or example:

for a=1, 10 do --Or while true do
gui.Postion = UDim2.new(1,1,1,1) --Completely random
end

Then in another script you have this:

if gui.Position == UDim2(0.3,0,0.3,0) then

end

You might need this:

while true do
wait(1) --Any value
if gui.Position == UDim2.(0.3,0,0.3,0) then
end

Or you might need this (this one probably isn't correct):

while true do
wait(1) --Any value
if gui.UDim2 == (0.3,0,0.3,0) then

end
end

Sorry if none of these work :/

Report Abuse
Mintacle is not online. Mintacle
Joined: 28 Aug 2013
Total Posts: 498
27 Nov 2015 03:55 PM
I greatly appreciate all of the help you guys have offered!
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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