|
| 28 Aug 2014 01:19 PM |
There's a problem with the script that I made that was supposed to change all bricks to a particular material and color, but it only managed to change 1 brick's material and color.
map = game.Workspace["Stadium"]:GetChildren()
while true do wait(3) for i,v in pairs(map) do if v.Name == ("OutSurface") then v.BrickColor = BrickColor.new("Bright blue") v.Material = "Plastic" end end end
This was working absolutely fine.
I then wanted it to change back to normal, so I ended up editing the script to this
map = game.Workspace["Beyblade Stadium"]:GetChildren()
while true do wait(3) for i,v in pairs(map) do if v.Name == ("OutSurface") then v.BrickColor = BrickColor.new("Bright blue") v.Material = "Plastic" wait(5) v.BrickColor = BrickColor.new("Medium stone grey") v.Material = "DiamondPlate" end end end
But it only changes one brick. Can someone tell me what's wrong?
|
|
|
| Report Abuse |
|
|
Mitko0o1
|
  |
| Joined: 30 Nov 2010 |
| Total Posts: 5725 |
|
|
| 28 Aug 2014 01:23 PM |
while true do wait(3) for i,v in pairs(map) do if v.Name == ("OutSurface") then v.BrickColor = BrickColor.new("Bright blue") v.Material = "Plastic" end wait (5) for i,v in pairs(map) do v.BrickColor = BrickColor.new("Medium stone grey") v.Material = "DiamondPlate" end end
I'm not making this in studio so I have no idea if there are any errors or not. |
|
|
| Report Abuse |
|
|
Mitko0o1
|
  |
| Joined: 30 Nov 2010 |
| Total Posts: 5725 |
|
|
| 28 Aug 2014 01:25 PM |
Oh add the "if v.Name == ("OutSurface") then". wait(5) for i,v in pairs(map) do if v.Name == ("OutSurface") then --<<< |
|
|
| Report Abuse |
|
|
|
| 29 Aug 2014 03:31 AM |
| It end's up not changing the color to bright blue. It just leaves it there. |
|
|
| Report Abuse |
|
|
|
| 29 Aug 2014 03:33 AM |
@Mitko
In your script: while true do wait(3) for i,v in pairs(map) do if v.Name == ("OutSurface") then v.BrickColor = BrickColor.new("Bright blue") v.Material = "Plastic" end <--- wait (5) for i,v in pairs(map) do v.BrickColor = BrickColor.new("Medium stone grey") v.Material = "DiamondPlate" end end
I found out that when you put "end" where the arrow is pointing it does nothing, but when you remove it, it just recolors one brick. |
|
|
| Report Abuse |
|
|
| |
|