AznD3viL
|
  |
| Joined: 25 Sep 2009 |
| Total Posts: 26 |
|
|
| 31 Dec 2016 05:49 AM |
I wanted to make a script that was just for fun cause I'm new to scripting was wondering if you could help me understand why my script isn't working.
03:47:35.300 - Workspace.Rainbowblock.Script:4: 'do' expected near 'red' <--- error line
local rainbowblock = game.Workspace.Rainbowblock
while rainbowblock.BrickColor == Really red do rainbowblock.BrickColor == Bright yellow wait(1) while rainbowblock.BrickColor == Bright yellow do rainbowblock.BrickColor == Lapis wait(1) while rainbowblock.BrickColor == Lapis do rainbowblock.BrickColor == Plum wait(1) while rainbowblock == rainbowplum do rainbowblock.BrickColor == Really red end end end end end end
end
|
|
|
| Report Abuse |
|
|
|
| 31 Dec 2016 07:03 AM |
while wait(1) do script.Parent.BrickColor = BrickColor.Random() end
ez |
|
|
| Report Abuse |
|
|
|
| 31 Dec 2016 07:12 AM |
BrickColor = BrickColor.new("Really red")
When using if statements, you need two ='s Otherwise only one =
All brickcolors must be assigned with BrickColor.new("your color here") |
|
|
| Report Abuse |
|
|
AznD3viL
|
  |
| Joined: 25 Sep 2009 |
| Total Posts: 26 |
|
|
| 31 Dec 2016 07:18 PM |
| this didn't work for me I got an error at = |
|
|
| Report Abuse |
|
|
AznD3viL
|
  |
| Joined: 25 Sep 2009 |
| Total Posts: 26 |
|
|
| 31 Dec 2016 07:19 PM |
| @gom is there anyway you can explain what script.parent means, i know it is a directory but how do you know when to use it? is the parent of the script the part? |
|
|
| Report Abuse |
|
|
|
| 01 Jan 2017 12:17 AM |
It's the parent of the script.
That's all.
If you were to put a script in a brick, the script.Parent of that script would be the brick |
|
|
| Report Abuse |
|
|
|
| 01 Jan 2017 12:41 AM |
local rainbowblock = game.Workspace.Rainbowblock
while true do game.Workspace.Rainbowblock.BrickColor = BrickColor.Random() wait(1) end |
|
|
| Report Abuse |
|
|
F2PGames
|
  |
| Joined: 22 Jun 2015 |
| Total Posts: 67 |
|
|
| 01 Jan 2017 12:43 AM |
@coolrobert
Why make a variable that you're not going to use? Why overcomplicate the script at all? |
|
|
| Report Abuse |
|
|
Quasar99
|
  |
| Joined: 21 Nov 2009 |
| Total Posts: 9328 |
|
|
| 01 Jan 2017 12:44 AM |
while wait(1) do game.Workspace.RainbowBlock.BrickColor = BrickColor.random() end
|
|
|
| Report Abuse |
|
|
|
| 01 Jan 2017 12:46 AM |
| Sorry. I'm using a tablet with typing. Plus I just did it on the top of my mind. |
|
|
| Report Abuse |
|
|
AznD3viL
|
  |
| Joined: 25 Sep 2009 |
| Total Posts: 26 |
|
|
| 01 Jan 2017 08:45 PM |
| everyone is saying do .random but I didn't want random colors, the objective was to make it show really red, bright yellow, lapis, plum, then when it hits plum it loops back to red. |
|
|
| Report Abuse |
|
|
|
| 01 Jan 2017 09:00 PM |
here
local rainbowblock=game.Workspace.Rainbowblock for i=1,math.huge do rainbowblock.BrickColor=BrickColor.new(Color3.fromHSV((i%360)/360,1,1)) wait() end
|
|
|
| Report Abuse |
|
|
|
| 01 Jan 2017 09:37 PM |
while wait(1) do rainbowblock.BrickColor = BrickColor.Random() if rainbowblock.BrickColor == BrickColor.Random() then rainbowblock.BrickColor = BrickColor.Random() end end
attempt to call girlfriend (a nil value) | (͠≖ ͜ʖ͠≖)👌 | nothin' like a good argument ¯\_(ツ)_/¯ |
|
|
| Report Abuse |
|
|