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: Herp Derp

Previous Thread :: Next Thread 
bananacupcake is not online. bananacupcake
Joined: 15 Jun 2010
Total Posts: 571
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 is not online. 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
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
08 Jun 2012 05:49 PM
@Neon

It's "Bright red".

† KMXD †
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
08 Jun 2012 05:50 PM
Whoops. I meant "Really red".

† KMXD †
Report Abuse
bananacupcake is not online. bananacupcake
Joined: 15 Jun 2010
Total Posts: 571
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
bananacupcake is not online. bananacupcake
Joined: 15 Jun 2010
Total Posts: 571
08 Jun 2012 06:11 PM
*cough*
Report Abuse
NeonBlox is not online. NeonBlox
Joined: 19 Oct 2008
Total Posts: 1462
08 Jun 2012 06:15 PM
My apologies, I thought 'red' was capitalized.
Report Abuse
bananacupcake is not online. bananacupcake
Joined: 15 Jun 2010
Total Posts: 571
08 Jun 2012 08:22 PM
*COUGH*
Report Abuse
miz656 is not online. 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
bananacupcake is not online. bananacupcake
Joined: 15 Jun 2010
Total Posts: 571
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 is not online. 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
bananacupcake is not online. bananacupcake
Joined: 15 Jun 2010
Total Posts: 571
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
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