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: So I have this Disco script...

Previous Thread :: Next Thread 
dribson5 is not online. dribson5
Joined: 20 Nov 2010
Total Posts: 31
13 Jul 2011 03:49 PM
and when the brick's color is Really Black, it's supposed to remove the script, thus stopping the disco effect.

The script is removed, but the color keeps changing.
How do I fix it?
Report Abuse
61352151511 is not online. 61352151511
Joined: 30 Nov 2009
Total Posts: 8094
13 Jul 2011 03:49 PM
before you remove the script make it disabled

~ Mitch ~
Report Abuse
dribson5 is not online. dribson5
Joined: 20 Nov 2010
Total Posts: 31
13 Jul 2011 03:52 PM
It doesn't seem to work like that, either.
Let me try tinkering with it more until it works.
Report Abuse
dribson5 is not online. dribson5
Joined: 20 Nov 2010
Total Posts: 31
13 Jul 2011 03:57 PM
Yeah, the script doesn't like me.
Here's the script:

local brick = script.Parent

while true do
brick.BrickColor = BrickColor.random()
wait(0.25)
if brick.BrickColor == BrickColor.new("Really Black") then
script.Disabled = true
wait(0.0000000009846798423692846298751)
script:remove()
end
end
Report Abuse
deathman12e3 is not online. deathman12e3
Joined: 10 Nov 2009
Total Posts: 7284
13 Jul 2011 03:58 PM
while true do
brick.BrickColor = BrickColor.random()
wait(0.25)
if brick.BrickColor == BrickColor.new("Really Black") then
wait()
script:remove()
end
end
Report Abuse
dribson5 is not online. dribson5
Joined: 20 Nov 2010
Total Posts: 31
13 Jul 2011 04:00 PM
@death

That's the same thing as I said about earlier.
I need the script to be disabled, but when I try, nothing happens, or the script keeps going and is removed.
Report Abuse
stoopidfaic is not online. stoopidfaic
Joined: 02 Jul 2011
Total Posts: 284
13 Jul 2011 04:04 PM
local brick = script.Parent
a = true
while a == true do
brick.BrickColor = BrickColor.random()
wait(0.25)
end
if brick.BrickColor == BrickColor.new("Really Black") then
a = false
script:remove()
end


Try this and tell me what happens.
Report Abuse
chikenugget is not online. chikenugget
Joined: 09 May 2009
Total Posts: 2552
13 Jul 2011 04:05 PM
while true do
brick.BrickColor = BrickColor.random()
wait(0.25)
if brick.BrickColor == BrickColor.new("Really Black") then
break
end
end
Report Abuse
stoopidfaic is not online. stoopidfaic
Joined: 02 Jul 2011
Total Posts: 284
13 Jul 2011 04:07 PM
Don't if statements glitch up loops?


I was working with a for statement earlier and had to move the if satement outside the for loop because it broke the for loop prematurely.
Report Abuse
dribson5 is not online. dribson5
Joined: 20 Nov 2010
Total Posts: 31
13 Jul 2011 04:10 PM
Neither of those work.
Neither of those remove the script.
Neither of those stop the disco effect.

I can spam paint it Really Black and nothing happpens.
Report Abuse
dribson5 is not online. dribson5
Joined: 20 Nov 2010
Total Posts: 31
13 Jul 2011 04:11 PM
"Don't if statements glitch up loops?"

Do they? Probably.
I didn't know that.
I'll just have to go the boring way...
Report Abuse
dekkonot is not online. dekkonot
Joined: 22 Dec 2010
Total Posts: 6685
13 Jul 2011 04:12 PM
while true do
brick.BrickColor = BrickColor.random()
wait(0.25)
if brick.BrickColor == BrickColor.new("Really Black") then
break
script:remove()
end
end
Report Abuse
deathman12e3 is not online. deathman12e3
Joined: 10 Nov 2009
Total Posts: 7284
13 Jul 2011 04:12 PM
while true do
brick.BrickColor = BrickColor.random()
wait(0.25)
if brick.BrickColor == BrickColor.new("Really Black") then
wait()
break
script:remove()
end
end


I forgot the 'break'. You need to break the loop to cause it to stop.
Report Abuse
IAmItYouAreIn is not online. IAmItYouAreIn
Joined: 20 Feb 2011
Total Posts: 304
13 Jul 2011 04:14 PM
[ Content Deleted ]
Report Abuse
stoopidfaic is not online. stoopidfaic
Joined: 02 Jul 2011
Total Posts: 284
13 Jul 2011 04:16 PM
The if statement isn't running... hmmm
Report Abuse
stoopidfaic is not online. stoopidfaic
Joined: 02 Jul 2011
Total Posts: 284
13 Jul 2011 04:28 PM
Maybe use a repeat/until statement istead of while true do.
Report Abuse
deathman12e3 is not online. deathman12e3
Joined: 10 Nov 2009
Total Posts: 7284
13 Jul 2011 04:31 PM
while true do
wait()

color = BrickColor.random()

script.Parent.BrickColor = color

if color == BrickColor.new("Really black") then
script.Disabled = true
break
end

end
Report Abuse
stoopidfaic is not online. stoopidfaic
Joined: 02 Jul 2011
Total Posts: 284
13 Jul 2011 04:45 PM
You could also make 2 scripts, one with the while true do and one for the id statement.
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