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: GUI Rotation

Previous Thread :: Next Thread 
CategoricalSyllogism is not online. CategoricalSyllogism
Joined: 30 Aug 2013
Total Posts: 7680
03 Oct 2014 09:07 PM
I'd like to make a while loop, rotating a GUI continuously and seamlessly until you click a button.
I don't know how to code the endless rotation efficiently, I can do the rest if I just have that part.

Report Abuse
CategoricalSyllogism is not online. CategoricalSyllogism
Joined: 30 Aug 2013
Total Posts: 7680
03 Oct 2014 09:14 PM
how 2 do
Report Abuse
CategoricalSyllogism is not online. CategoricalSyllogism
Joined: 30 Aug 2013
Total Posts: 7680
03 Oct 2014 09:20 PM
c:
Report Abuse
CategoricalSyllogism is not online. CategoricalSyllogism
Joined: 30 Aug 2013
Total Posts: 7680
03 Oct 2014 09:23 PM
;D
Report Abuse
Yourfirstnightmare is not online. Yourfirstnightmare
Joined: 28 May 2013
Total Posts: 3
03 Oct 2014 09:24 PM
I'd say CFrame.angles. But in this case maybe theres a udim2.angles...
Report Abuse
CategoricalSyllogism is not online. CategoricalSyllogism
Joined: 30 Aug 2013
Total Posts: 7680
03 Oct 2014 09:25 PM
yeah i haven't worked with guis in a while.
Report Abuse
CategoricalSyllogism is not online. CategoricalSyllogism
Joined: 30 Aug 2013
Total Posts: 7680
03 Oct 2014 09:35 PM
for i = 9, 0, -1 do
survive.TextTransparency = i/10
wait()
end

...Sort of what I'm trying to do, except with rotation and not transparency.
Report Abuse
CategoricalSyllogism is not online. CategoricalSyllogism
Joined: 30 Aug 2013
Total Posts: 7680
03 Oct 2014 09:44 PM
awdf
Report Abuse
CategoricalSyllogism is not online. CategoricalSyllogism
Joined: 30 Aug 2013
Total Posts: 7680
03 Oct 2014 09:54 PM
need.
information.
Report Abuse
Hunter4529 is not online. Hunter4529
Joined: 20 Oct 2013
Total Posts: 675
03 Oct 2014 09:56 PM
while wait() do
gui.Rotation = gui.Rotation + 1
if gui.Rotation == 360 then
gui.Rotation = 0
end
end
Report Abuse
CategoricalSyllogism is not online. CategoricalSyllogism
Joined: 30 Aug 2013
Total Posts: 7680
03 Oct 2014 10:03 PM
it's that easy, huh?

thanks.
Report Abuse
Hunter4529 is not online. Hunter4529
Joined: 20 Oct 2013
Total Posts: 675
03 Oct 2014 10:03 PM
Yeah rotation is a property in Gui objects
Report Abuse
CategoricalSyllogism is not online. CategoricalSyllogism
Joined: 30 Aug 2013
Total Posts: 7680
03 Oct 2014 10:06 PM
i knew that part. just didn't get how to do anything else. xD
Report Abuse
nicemike40 is not online. nicemike40
Joined: 19 Dec 2008
Total Posts: 1814
03 Oct 2014 10:06 PM
Use >= though, == can get messy.
Report Abuse
CategoricalSyllogism is not online. CategoricalSyllogism
Joined: 30 Aug 2013
Total Posts: 7680
03 Oct 2014 10:07 PM
k
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
03 Oct 2014 10:07 PM
while true do
for r = 0, 359 do
gui.Rotation = r
wait(0.03)
end
end


As far as making it stop from a separate script, .Disable = true the script above

To disable it from the same script

local rotate = true
thingYouClick.MouseButton1Click:connect(function()
rotate = false
end)

while rotate do
for r = 0, 359 do
gui.Rotation = r
wait(0.03)
end
end
Report Abuse
CategoricalSyllogism is not online. CategoricalSyllogism
Joined: 30 Aug 2013
Total Posts: 7680
03 Oct 2014 10:53 PM
This is what I have:

survive = script.Parent.survive
background = script.Parent.background
play = script.Parent.play

wait(8)
for i = 9, 0, -1 do
survive.TextTransparency = i/10
wait()
end
wait(2)

local rotate = true
play.MouseButton1Click:connect(function()
rotate = false
end)

while rotate do
for r = 0, 359 do
survive.Rotation = r
wait(0.03)
end
end

wait(5)
for i = 1, 10 do
survive.TextTransparency = i/10
end


That's the entire script, my sourcing is correct, but when you click play it does nothing.
Report Abuse
iiUltimate is not online. iiUltimate
Joined: 29 Mar 2012
Total Posts: 3694
03 Oct 2014 10:57 PM
survive = script.Parent.survive
background = script.Parent.background
play = script.Parent.play

wait(8)
for i = 9, 0, -1 do
survive.TextTransparency = i/10
wait()
end

wait(2)

rotate = true

play.MouseButton1Click:connect(function()
rotate = false
end)

while rotate do
for r = 0, 359 do
survive.Rotation = r
wait(0.03)
end
end

wait(5)

for i = 1, 10 do
survive.TextTransparency = i/10
end

I'm not a good scripter, I do however believe that if you remove the "local" from the variable it will work. Since local variables don't work outside of their location.
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
03 Oct 2014 11:01 PM
survive = script.Parent.survive
background = script.Parent.background
play = script.Parent.play

wait(8)
for i = 9, 0, -1 do
survive.TextTransparency = i/10
wait()
end
wait(2)

local rotate = false
play.MouseButton1Click:connect(function()
rotate = true
end)

while not rotate do
for r = 0, 359 do
survive.Rotation = r
wait(0.03)
if rotate then break end
end
end

wait(5)
for i = 1, 10 do
survive.TextTransparency = i/10
end
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
03 Oct 2014 11:05 PM
Local variables should always be used
Sometimes a slight workaround might be needed, but you can ALWAYS use them and always should


They work within scopes within a scope


if true then
local a = true
print(a) -->true
if not false then
print(a) -->true
end
end
print(a) -->nil


The workaround


Sometimes you might for some reason need this

for _, v in pairs (game.Players:GetPlayers()) do
if --[[something about the player]] then
local a = v
end
end
print(v.Name) -->error


You would make it local like this


local a; --Localizing a
for _, v in pairs (game.Players:GetPlayers()) do
if --[[something about the player]] then
a = v --Still local because we already localized a
end
end
print(v.Name) -->players name
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