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 » Club Houses » ROBLOX Talk
Home Search
 

Re: how do you make the circle to look like this?

Previous Thread :: Next Thread 
Legalizes is not online. Legalizes
Joined: 21 May 2016
Total Posts: 5107
14 Nov 2016 07:02 AM
http://wiki.roblox.com/index.php?title=Circle

the alternating color??



Report Abuse
anything4posts is not online. anything4posts
Joined: 31 Jul 2011
Total Posts: 50345
14 Nov 2016 07:06 AM
beats me
Report Abuse
Spirographic is not online. Spirographic
Joined: 17 Aug 2007
Total Posts: 19084
14 Nov 2016 07:06 AM
Haven't touched Lua in a while, so you may have to correct some stuff but:

if (i % 2) == 0 then
p.BrickColor = BrickColor.new(whatever)
end

The modulo operator is cool.
Report Abuse
Legalizes is not online. Legalizes
Joined: 21 May 2016
Total Posts: 5107
14 Nov 2016 07:10 AM
IT WORKS BUT HOW

Report Abuse
Spirographic is not online. Spirographic
Joined: 17 Aug 2007
Total Posts: 19084
14 Nov 2016 07:14 AM
@Legal
The modulo operator(%) returns the remainder of a division problem, and if there is no remainder, it returns 0.

So,
100 / 2 = 50. Since there's no decimal point, 100 % 2 = 0.
99 / 2 = 49.5. Since there is a decimal point, 99 % 2 = 1.

I don't recall exactly how it works out the remainder, but it should be self-explanatory if you've ever done long division without a calculator.
Report Abuse
Legalizes is not online. Legalizes
Joined: 21 May 2016
Total Posts: 5107
14 Nov 2016 07:15 AM
OK I UNDERSTAND
AND JUST HOW TO MAKE THE CIRCLE CHANGE COLOR EVERY 3 SECOND?

I TRY THE LOOP
P.BRICKCOLOR = BRICKCOLOR.NEW("LIME")
P.BRICKCOLOR = BRICKCOLOR.NEW("rEALLY RED")
etc

Report Abuse
Spirographic is not online. Spirographic
Joined: 17 Aug 2007
Total Posts: 19084
14 Nov 2016 07:23 AM
That's a more difficult question, and I can't exactly give a code block for it without writing your whole script for you.

Basically, you have to add the blocks to either a model or array first. Then, you iterate through the model/array changing the brickColor.

The reason you want to do this rather than just using the 'p' variable is because p is#t##own out at the end of one of the "i" things. (There are subr########### the like, but they're difficult to understand and bad for performance)

So you then need to make a new, outside loop, and then either using array functions or GetChildren(), you change the colours of the parts as needed.

to demonstrate in a barebones way:

local m = Instance.new("Model")
m.Parent = workspace

for i = 1,2 do
p = Instance.new("Part")
p.Position = Vector3.new(0,i,0)
p.Parent = m
end

while wait(3) do
for _,part in pairs(m:GetChildren()) do
part.BrickColor = BrickColor.red
end
wait(3)
for _,part in pairs(m:GetChildren()) do
part.BrickColor = BrickColor.green
end
end


This should work, but again, I haven't touched Lua in a while proper, so I may have messed up somewhere.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Club Houses » ROBLOX Talk
   
 
   
  • 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