KCNx12
|
  |
| Joined: 09 Jul 2008 |
| Total Posts: 3230 |
|
|
| 27 Sep 2012 02:46 PM |
I am one of the most amateur scripters, and I need help with this script here:
Workspace.ColorChanger.Script:18: 'end' expected (to close 'function' at line 1) near eof function onHit(hit) wait(1) print("Is this going to work? :o") while true do Num = math.random(1,3) if Num == 1 then script.Parent.BrickColor = Color3.new("Bright red") end if Num == 2 then script.Parent.BrickColor = Color3.new("Bright blue") end if Num == 3 then script.Parent.BrickColor = Color3.new("Bright green") end end
script.Parent.Touched:connect(onHit)
|
|
|
| Report Abuse |
|
|
|
| 27 Sep 2012 02:50 PM |
Missed an end.
function onHit(hit) wait(1) print("Is this going to work? :o") while true do Num = math.random(1,3) if Num == 1 then script.Parent.BrickColor = Color3.new("Bright red") end if Num == 2 then script.Parent.BrickColor = Color3.new("Bright blue") end if Num == 3 then script.Parent.BrickColor = Color3.new("Bright green") end end end
script.Parent.Touched:connect(onHit)
~ ROBERT00001 ~ ~(ಠωಠ)~ |
|
|
| Report Abuse |
|
|
Fedorakid
|
  |
| Joined: 17 Jul 2010 |
| Total Posts: 7079 |
|
|
| 27 Sep 2012 02:50 PM |
| I dont get this script, what is it supposed to do? |
|
|
| Report Abuse |
|
|
|
| 27 Sep 2012 03:14 PM |
@Robert, you too missed an end.
function onHit(hit) wait(1) print("Is this going to work? :o") while true do Num = math.random(1,3) if Num == 1 then script.Parent.BrickColor = Color3.new("Bright red") end if Num == 2 then script.Parent.BrickColor = Color3.new("Bright blue") end if Num == 3 then script.Parent.BrickColor = Color3.new("Bright green") end end end end
script.Parent.Touched:connect(onHit) |
|
|
| Report Abuse |
|
|
|
| 27 Sep 2012 03:21 PM |
NOPE ಠ_ಠ
~ ROBERT00001 ~ ~(ಠωಠ)~ |
|
|
| Report Abuse |
|
|
| |
|
|
| 27 Sep 2012 03:30 PM |
TESTED
NO SYNTAX ERRORS OCCURED TO MINE
~ ROBERT00001 ~ ~(ಠωಠ)~ |
|
|
| Report Abuse |
|
|
|
| 27 Sep 2012 03:32 PM |
| Oh, my bad. Didn't see the whole thing. I was just counting the if's and the function. Sorry :I |
|
|
| Report Abuse |
|
|
|
| 27 Sep 2012 03:33 PM |
function onHit(hit) -- 1 end wait(1) print("Is this going to work? :o") while true do - 2 end Num = math.random(1,3) if Num == 1 then script.Parent.BrickColor = Color3.new("Bright red") end if Num == 2 then script.Parent.BrickColor = Color3.new("Bright blue") end if Num == 3 then script.Parent.BrickColor = Color3.new("Bright green") end end -- 2 end end -- 1 end
Robert wins |
|
|
| Report Abuse |
|
|
|
| 27 Sep 2012 03:34 PM |
| Monkey just took the whole thought out of my head. o_o |
|
|
| Report Abuse |
|
|
Xlaive
|
  |
| Joined: 25 Aug 2012 |
| Total Posts: 97 |
|
|
| 27 Sep 2012 04:00 PM |
function onHit(hit) wait(1) local Num = math.random(3) if Num == 1 then script.Parent.BrickColor = BrickColor.new("Bright red") elseif Num == 2 then script.Parent.BrickColor = BrickColor.new("Bright blue") elseif Num == 3 then script.Parent.BrickColor = BrickColor.new("Bright green") end end script.Parent.Touched:connect(onHit) |
|
|
| Report Abuse |
|
|
|
| 27 Sep 2012 04:15 PM |
Whoa, Robert, I haven't seen you here in a while. Over a year, in fact. :o
http://wiki.roblox.com/index.php/User:ElectricBlaze |
|
|
| Report Abuse |
|
|
rayoma
|
  |
| Joined: 13 Nov 2009 |
| Total Posts: 1911 |
|
|
| 27 Sep 2012 05:34 PM |
| You don't need the while loop in there or it will just cause a stack overflow error. Also you need to change the `Color3.new` to `BrickColor.new` |
|
|
| Report Abuse |
|
|
|
| 27 Sep 2012 06:31 PM |
Hooplah!
http://www.roblox.com/The-Roblox-Quiz-place?id=93016262 Checkout The Roblox Quiz!™, PM me any suggestions or questions you want me to add. It's still not finish. |
|
|
| Report Abuse |
|
|