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: Why doesnt this script work?

Previous Thread :: Next Thread 
are31 is not online. are31
Joined: 09 Nov 2007
Total Posts: 13767
15 Sep 2011 04:05 PM
script.Parent.Light.ClickDetector.MouseClick:connect(function()
for i = 1, 12 do
local Part = script.Parent['Part' .. i]
Part.BrickColor = BrickColor.new((Part.BrickColor == BrickColor.Yellow())
end
end)
Report Abuse
zeke505 is not online. zeke505
Joined: 26 May 2008
Total Posts: 15765
15 Sep 2011 04:06 PM
Creating another thread doesn't help. Bump the other one instead of spamming.
Report Abuse
swimguy777 is not online. swimguy777
Joined: 30 May 2009
Total Posts: 17092
15 Sep 2011 04:06 PM
Part.BrickColor = BrickColor.Yellow()

-[::ƧѡÎḾḠΰῩ::]-
-[::Maker of stuff and breaker of combos::]-
Report Abuse
are31 is not online. are31
Joined: 09 Nov 2007
Total Posts: 13767
15 Sep 2011 04:07 PM
swim, can you edit that into the script, because i dont know where to put that to make it work
Report Abuse
swimguy777 is not online. swimguy777
Joined: 30 May 2009
Total Posts: 17092
15 Sep 2011 04:09 PM
You delete the line that looks like it and put that in place of it.

-[::ƧѡÎḾḠΰῩ::]-
-[::Maker of stuff and breaker of combos::]-
Report Abuse
are31 is not online. are31
Joined: 09 Nov 2007
Total Posts: 13767
15 Sep 2011 04:11 PM
so the script would look like this?

script.Parent.Light.ClickDetector.MouseClick:connect(function()
for i = 1, 12 do
local Part = script.Parent['Part' .. i]
Part.BrickColor = BrickColor.Yellow()
end
end)
Report Abuse
BlockScripter is not online. BlockScripter
Joined: 02 Jan 2011
Total Posts: 65
15 Sep 2011 04:15 PM
you could do what swim said, or you can just change the == from the original script to an =
script.Parent.Light.ClickDetector.MouseClick:connect(function()
for i = 1, 12 do
local Part = script.Parent['Part' .. i]
Part.BrickColor = BrickColor.new((Part.BrickColor = BrickColor.Yellow())
end
end)

== means is

= means make it

so Part.BrickColor == BrickColor.Yellow() is used to check if it is yellow

Part.BrickColor = BrickColor.Yellow() is used to make it yellow
Report Abuse
are31 is not online. are31
Joined: 09 Nov 2007
Total Posts: 13767
15 Sep 2011 04:18 PM
thank you!! im going to try it out!
Report Abuse
BlockScripter is not online. BlockScripter
Joined: 02 Jan 2011
Total Posts: 65
15 Sep 2011 04:20 PM
No problem, let me know if it still doesn't work. I may know the problem if it doesn't work.
Report Abuse
are31 is not online. are31
Joined: 09 Nov 2007
Total Posts: 13767
15 Sep 2011 04:25 PM
ok yea it didnt work, but now the bricks arnt called part1, part2 and so on.
i named it Bart1 Bart2 and so on because the thing said 'Part" ..

which means every brick will turn yellow in my place im building
so use Bart this time and can you fix it?
Report Abuse
BlockScripter is not online. BlockScripter
Joined: 02 Jan 2011
Total Posts: 65
15 Sep 2011 04:31 PM
for i = 1, 12 do
local Part = script.Parent['Bart1' .. i]
Part.BrickColor = BrickColor.new((Part.BrickColor = BrickColor.Yellow())
end
end)

put this script in a model with the bricks.
Report Abuse
are31 is not online. are31
Joined: 09 Nov 2007
Total Posts: 13767
15 Sep 2011 05:27 PM
ugh... scripts never work for me. i always have to give up because every single one i try to make fails, ive tried every answer and none of them have worked. :(
Report Abuse
BlockScripter is not online. BlockScripter
Joined: 02 Jan 2011
Total Posts: 65
15 Sep 2011 06:57 PM
Tell me what you need, I can make the brick and the script and then you can take it and add it into your game.
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