generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Map change color problem

Previous Thread :: Next Thread 
RobbloxTrollinho is not online. RobbloxTrollinho
Joined: 05 Feb 2010
Total Posts: 13
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 is not online. 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 is not online. 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
RobbloxTrollinho is not online. RobbloxTrollinho
Joined: 05 Feb 2010
Total Posts: 13
29 Aug 2014 03:31 AM
It end's up not changing the color to bright blue. It just leaves it there.
Report Abuse
RobbloxTrollinho is not online. RobbloxTrollinho
Joined: 05 Feb 2010
Total Posts: 13
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
RobbloxTrollinho is not online. RobbloxTrollinho
Joined: 05 Feb 2010
Total Posts: 13
29 Aug 2014 03:34 AM
and the material.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image