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: Random GUI Movement and Changing GUI Image

Previous Thread :: Next Thread 
werts150 is not online. werts150
Joined: 11 Nov 2012
Total Posts: 1450
02 Jan 2013 07:13 PM
Since I can't rotate GUIs, I guess I'll have to do this the hard way:
I have a frog image GUI, and I want it to move randomly in 4 directions. (left, right, up, down) I also want it to change images in the direction it's facing. Is there a wiki page I could go to? I tried searching for one, but I couldn't find anything. There were literally only 2 results on google. How do I start?
Report Abuse
jknite is not online. jknite
Joined: 30 Nov 2007
Total Posts: 614
02 Jan 2013 07:22 PM
UDim2.new(x,x,y,y) is for the position to give it the set position.

Here is the wiki for Tweening the Position. I am unaware of any other methods posted on the wiki.
http://wiki.roblox.com/index.php/TweenPosition_(Method)
Report Abuse
werts150 is not online. werts150
Joined: 11 Nov 2012
Total Posts: 1450
02 Jan 2013 07:51 PM
So I looked at the wiki, and I've been trying everything but this script won't work.

script.Parent:TweenPosition(UDim2.new(1, 0, 0, 0), "Out", "Quad", 3, true)
wait(1.5)
script.Parent:TweenPosition(UDim2.new(0.5, 0, 1, 0), "Out", "Quad", 3, false)

I put it inside the GUI I want to move, and nothing happens. What do I need to change?
Report Abuse
werts150 is not online. werts150
Joined: 11 Nov 2012
Total Posts: 1450
02 Jan 2013 09:33 PM
Nevermind, I got it to work. So how would I change this script:
script.Parent:TweenPosition(UDim2.new(0.5, 0, 0.3, 0), "Out", "Quad", 4, false, nil)
to make it random? Would I use math.random? If I do, how?
Report Abuse
thecaptain97 is not online. thecaptain97
Joined: 17 Jun 2010
Total Posts: 4987
02 Jan 2013 09:36 PM
script.Parent:TweenPosition(UDim2.new(0, math.random(0,400), 0, math.random(0,400)), "Out", "Quad", 4, false, nil)
Report Abuse
werts150 is not online. werts150
Joined: 11 Nov 2012
Total Posts: 1450
02 Jan 2013 09:44 PM
Wow, thanks!
Now just one last thing. I added a loop so he keeps moving over and over in random directions, but now I need him to change directions. Since it's not really in 4 directions anymore, is there any way to do it without making 100 different decals of the same frog, just rotated? If I can't make rotated decals, and I can't make tons of decals, how else can I do it? Is there a way?
Report Abuse
werts150 is not online. werts150
Joined: 11 Nov 2012
Total Posts: 1450
02 Jan 2013 10:36 PM
Oh, I forgot... Here is my script so far:

while true do
script.Parent:TweenPosition(UDim2.new(0, math.random(0,400), 0, math.random(0,400)), "Out", "Quad", 3, false, nil)
wait(4)
script.Parent:TweenPosition(UDim2.new(0, math.random(0,400), 0, math.random(0,400)), "Out", "Quad", 3, false, nil)
end
Report Abuse
kolby324 is not online. kolby324
Joined: 02 Jan 2009
Total Posts: 62
02 Jan 2013 11:55 PM
you take bread, preheat the oven at 350 degrees, then bake the gui for a good 50 minutes. (don't forget to add the yeast)
Report Abuse
werts150 is not online. werts150
Joined: 11 Nov 2012
Total Posts: 1450
03 Jan 2013 01:45 PM
This is scripting helpers not bread bakers. Either you help or you leave.
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