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
|
  |
| 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 |
|
|
|
| 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
|
  |
| Joined: 19 Nov 2009 |
| Total Posts: 547 |
|
| |
|
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
|
  |
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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
|
  |
| 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 |
|
|