rex103
|
  |
| Joined: 03 Oct 2008 |
| Total Posts: 162 |
|
|
| 26 Jul 2012 09:22 PM |
Hey, I'm new to scripting, and don't really understand much yet, but i wrote this script:
function OnTouched (hit) game.Workspace.Captureb game.Workspace.Captureb.BrickColor=BrickColor.new(255) game.Workspace.Stand.BrickColor=BrickColor.new(255) print(The Checkpoint Has Been Taken) end
what is is supposed to do, is when you touch a button, it, and the plate it is on top of is supposed to turn Really Blue (255?), and is is supposed to print The Checkpoint Has Been Taken
Is there anything that I did wrong, or some thing I could add to make it work?
I would really like to know how to script stuff, and I think if I could get this to work, it would be a good start. |
|
|
| Report Abuse |
|
|
ballen7
|
  |
| Joined: 26 Sep 2008 |
| Total Posts: 819 |
|
|
| 26 Jul 2012 09:36 PM |
function OnTouched (hit) game.Workspace.Captureb game.Workspace.Captureb.BrickColor=BrickColor.new(255) game.Workspace.Stand.BrickColor=BrickColor.new(255) print(The Checkpoint Has Been Taken) end game.Workspace.Captureb.Touched:connect(OnTouched) |
|
|
| Report Abuse |
|
|
rex103
|
  |
| Joined: 03 Oct 2008 |
| Total Posts: 162 |
|
|
| 26 Jul 2012 09:47 PM |
Thanks, but I inserted it into the brick, and nothing happened when i touched it. Anybody have any ideas? |
|
|
| Report Abuse |
|
|
|
| 26 Jul 2012 10:13 PM |
Put this in the button.
function OnTouched(hit) game.Workspace.Captureb.BrickColor=BrickColor.new(255) game.Workspace.Stand.BrickColor=BrickColor.new(255) print(The Checkpoint Has Been Taken) end script.Parent.Touched:connect(OnTouched)
† KMXD † |
|
|
| Report Abuse |
|
|
rex103
|
  |
| Joined: 03 Oct 2008 |
| Total Posts: 162 |
|
|
| 27 Jul 2012 07:50 AM |
I tired that, and when I went on pley solo, the output box said:
Workspace.Captureb.Script:7: ')' expected near 'Checkpoint'
And after having lots of problems witht the print part, i chaged it to just "Checkpoint taken", so it looked like this:
function OnTouched(hit) game.Workspace.Captureb.BrickColor=BrickColor.new(255) game.Workspace.Stand.BrickColor=BrickColor.new(255) print(Checkpoint taken) end script.Parent.Touched:connect(OnTouched)
I tested it and the output box said
Workspace.Captureb.Script:7: ')' expected near 'taken'
I'm really confused now, it just seems like it should work
|
|
|
| Report Abuse |
|
|
Dr01d3k4
|
  |
| Joined: 11 Oct 2007 |
| Total Posts: 17916 |
|
|
| 27 Jul 2012 07:52 AM |
script.Parent.Touched:connect(function () game.Workspace.Captureb.BrickColor = BrickColor.new(255); game.Workspace.Stand.BrickColor = BrickColor.new(255); print("The Checkpoint Has Been Taken"); end); |
|
|
| Report Abuse |
|
|