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: Whats wrong with this script?

Previous Thread :: Next Thread 
javiman2 is not online. javiman2
Joined: 08 Jun 2010
Total Posts: 1453
18 Jul 2011 04:25 PM
First I am learning how to script and I need someone to tell me if this is right its for a brick to turn red when touched. Its for a target so you know if you hit the target, then turn back to the original color.


game.Workspace.Target
(onTouched).BrickColor.Red
wait(1)
BrickColor.White
Report Abuse
Rames7 is not online. Rames7
Joined: 19 Nov 2009
Total Posts: 547
18 Jul 2011 04:28 PM
function (ontouched)
if script.Parent.Brickcolor == ("White") == true then
script.Parent.Brickcolor = Brickcolor.new ("Bright Red")
wait(1)
script.Parent.Brickcolor = Brickcolor.new ("White")
end



--[[added a new feature :P

-R7

]]--
Report Abuse
SCARFACIAL is not online. SCARFACIAL
Joined: 28 Jan 2010
Total Posts: 7970
18 Jul 2011 04:29 PM
if script.Parent.Brickcolor == ("White") == true then

This will error.

if script.Parent.Brickcolor == ("White") then

Regards,
~Scarfacial
Report Abuse
Rames7 is not online. Rames7
Joined: 19 Nov 2009
Total Posts: 547
18 Jul 2011 04:30 PM
its the same thing LOL
Report Abuse
javiman2 is not online. javiman2
Joined: 08 Jun 2010
Total Posts: 1453
18 Jul 2011 04:30 PM
Thanks dude I keep having trouble to when to put the function in a script
Report Abuse
Rames7 is not online. Rames7
Joined: 19 Nov 2009
Total Posts: 547
18 Jul 2011 04:31 PM
--[[ Enjoy!

R7

]]--

function (ontouched)
if script.Parent.Brickcolor == ("White") == true then
script.Parent.Brickcolor = Brickcolor.new ("Bright Red")
wait(1)
script.Parent.Brickcolor = Brickcolor.new ("White")
end
Report Abuse
Rames7 is not online. Rames7
Joined: 19 Nov 2009
Total Posts: 547
18 Jul 2011 04:32 PM
ok main script!

function (ontouched)
if script.Parent.Brickcolor == ("White") then
script.Parent.Brickcolor = Brickcolor.new ("Bright Red")
wait(1)
script.Parent.Brickcolor = Brickcolor.new ("White")
end
Report Abuse
SCARFACIAL is not online. SCARFACIAL
Joined: 28 Jan 2010
Total Posts: 7970
18 Jul 2011 04:33 PM
Let me fix that for you Rames.

function (onTouched)
if script.Parent.BrickColor == ("White") then
script.Parent.BrickColor = Brickcolor.new ("Bright Red")
wait(1)
script.Parent.BrickColor = BrickColor.new ("White")
end end

script.Parent.Touched:connect(onTouched)

Regards,
~Scarfacial
Report Abuse
javiman2 is not online. javiman2
Joined: 08 Jun 2010
Total Posts: 1453
18 Jul 2011 04:34 PM
Can one of you give me scripting lessons? The wiki is to confusing for me.
Report Abuse
Rames7 is not online. Rames7
Joined: 19 Nov 2009
Total Posts: 547
18 Jul 2011 05:34 PM
Lol forgot function!

function onTouched()

if script.Parent.BrcikColor == ("White") then
script.Parent.BrickColor = BrickColor.new ("Bright red")
wait(1)
script.Parent.BrickColor = BrickColor.new ("White")
end
script.Parent.Touched:connect(onTouched)


--[[ Best Regards!

R7



--]]
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