|
| 08 Jun 2012 05:37 PM |
Color1 = BrickColor.new("Lime green") Color2 = BrickColor.new("Really red")
function onTouched(hit) local playerhit = hit.Parent:FindFirstChild("Humanoid")
if playerhit and script.Parent.Value.Value == 0 then script.Parent.Value.Value = 1 playerhit.Torso.CFrame = script.Parent.Parent.Tele2.CFrame while true do wait() script.Parent.BrickColor = BrickColor.random() end wait(3) script.Parent.BrickColor = Color1 script.Parent.Value.Value = 0 end end
script.Parent.Touched:connect(onTouched)
I want it to repeat a BrickColor.random() loop for 3 seconds and after those 3 seconds it change to Color1. Instead it just stays on the loop forever. I've tried 1000 ways to fix this, I can't seem to do it. :b |
|
|
| Report Abuse |
|
|
NeonBlox
|
  |
| Joined: 19 Oct 2008 |
| Total Posts: 1462 |
|
|
| 08 Jun 2012 05:48 PM |
| I didn't look over the script, but I can already see a error. To use BrickColors, you have to use their exact name. So BrickColor.new("Really red") would be BrickColor.new("Really Red"). |
|
|
| Report Abuse |
|
|
|
| 08 Jun 2012 05:49 PM |
@Neon
It's "Bright red".
† KMXD † |
|
|
| Report Abuse |
|
|
|
| 08 Jun 2012 05:50 PM |
Whoops. I meant "Really red".
† KMXD † |
|
|
| Report Abuse |
|
|
|
| 08 Jun 2012 05:52 PM |
| @Neon Wrong. The name of the color IS Really red. If I used 'Really Red' it would be wrong, therefor the script would not work. |
|
|
| Report Abuse |
|
|
| |
|
NeonBlox
|
  |
| Joined: 19 Oct 2008 |
| Total Posts: 1462 |
|
|
| 08 Jun 2012 06:15 PM |
| My apologies, I thought 'red' was capitalized. |
|
|
| Report Abuse |
|
|
| |
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 08 Jun 2012 08:27 PM |
| That's because you ended the while loop to early. |
|
|
| Report Abuse |
|
|
|
| 08 Jun 2012 08:31 PM |
| As I said I tried everything I could so can you fix it for me? :b |
|
|
| Report Abuse |
|
|
miz656
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 15336 |
|
|
| 08 Jun 2012 08:40 PM |
Color1 = BrickColor.new("Lime green") Color2 = BrickColor.new("Really red") --I'm not sure if those are the specific case sensitives. Don't argue with me.
function onTouched(hit) local playerhit = hit.Parent:FindFirstChild("Humanoid")
if playerhit and script.Parent.Value.Value == 0 then script.Parent.Value.Value = 1 hit.Parent.Torso.CFrame = script.Parent.Parent.Tele2.CFrame while true do for i = 1,math.huge do script.Parent.BrickColor = BrickColor.random() if i == 25 then break--change to line else wait() end end wait(3) script.Parent.BrickColor = Color1 script.Parent.Value.Value = 0 end end end script.Parent.Touched:connect(onTouched)
MAYBE???? :P |
|
|
| Report Abuse |
|
|
|
| 08 Jun 2012 08:52 PM |
I WAS SO HAPPY!!! Then got sad :(
It worked fine but then... :( The loop seems to never end. Well... it does... then is starts... then it stops... then it starts... It like twitches. :/ |
|
|
| Report Abuse |
|
|