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: Can't get this function working?

Previous Thread :: Next Thread 
friedspicychicken is not online. friedspicychicken
Joined: 11 Feb 2011
Total Posts: 701
23 Nov 2013 02:33 PM
Hi, so I am a REALLY new coder, I just started what, 3 hours ago? I need a little help here.

So for a basic script, I am trying to make a script which functions to make a brick named Happy turn to the color Really Red for 5 seconds, then revert to it's original color, white.

I've got all of the brick references and such, but the script doesn't seem to be working. Help?
Report Abuse
wazap is not online. wazap
Joined: 29 Jun 2007
Total Posts: 23234
23 Nov 2013 02:34 PM
Paste the code.... then we can help out...
Report Abuse
friedspicychicken is not online. friedspicychicken
Joined: 11 Feb 2011
Total Posts: 701
23 Nov 2013 02:34 PM
local brick = Workspace.Happy

function onTouch(part)
brick.BrickColor = ReallyRed
wait(5)
brick.BrickColor = White
end

brick.Touched:connect(onTouch)
Report Abuse
ToxicDominator is not online. ToxicDominator
Joined: 24 Oct 2013
Total Posts: 8373
23 Nov 2013 02:36 PM
local brick = Workspace.Happy

function onTouch(part)
brick.BrickColor = BrickColor.new("Really red")
wait(5)
brick.BrickColor = BrickColor.new("Institutional white")
end

brick.Touched:connect(onTouch)
Report Abuse
friedspicychicken is not online. friedspicychicken
Joined: 11 Feb 2011
Total Posts: 701
23 Nov 2013 02:37 PM
Wow, I was way off... Thank you though.
Report Abuse
bagwan12345 is not online. bagwan12345
Joined: 17 Dec 2009
Total Posts: 1498
23 Nov 2013 02:44 PM
That was in fact quite close, seeing that apparently you are a new scripter.

So what you want is:

BrickColor.new("Really red")

to change colour. There are other things like this, such as:

pt = Instance.new("Part", game.Workspace)

to create a new part which is inside the Workspace.
Report Abuse
friedspicychicken is not online. friedspicychicken
Joined: 11 Feb 2011
Total Posts: 701
23 Nov 2013 03:48 PM
@bag

Thanks for the pointers, man.

Scripting is a labyrinth for me...
Report Abuse
Poseidas is not online. Poseidas
Joined: 23 Nov 2008
Total Posts: 2659
23 Nov 2013 03:56 PM
You're off to a better start than a lot of people.

Yours truly, Poseidas
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