|
| 19 Feb 2012 05:42 PM |
How would I do this type of script where all parts named "Color Block(Map)" get a selection box and this script:
script.Parent.Adornee = script.Parent.Parent
local rainbow = {
BrickColor.new("Bright red"), BrickColor.new("Bright orange"), BrickColor.new("New Yeller"), BrickColor.new("Bright green"), BrickColor.new("Bright blue"), BrickColor.new("Lavender"), BrickColor.new("Bright violet"),
}
local thing = script.Parent local wt = .5
while true do wait() for i = 1, #rainbow do thing.Color = rainbow[i] wait(wt) end end
?????? --------------------------------------------------------------------------
This is what I have so far:
for i,v in pairs do if v.name = "Color Brick(Map)" then Instance.new("SelectionBox") Instance.new("Script")
script.Parent.Adornee = script.Parent.Parent
local rainbow = {
BrickColor.new("Bright red"), BrickColor.new("Bright orange"), BrickColor.new("New Yeller"), BrickColor.new("Bright green"), BrickColor.new("Bright blue"), BrickColor.new("Lavender"), BrickColor.new("Bright violet"),
}
local thing = script.Parent local wt = .5
while true do wait() for i = 1, #rainbow do thing.Color = rainbow[i] wait(wt) end end
end end end
|
|
|
| Report Abuse |
|
|
|
| 19 Feb 2012 05:48 PM |
For 1, Why are you doing this?
for i,v in pairs do You need to declare something inside this to scan through.
for i, v in ipairs (game.Players) do if v.Backpack ~= nil -- Code here end end
Get what I am saying? If you are trying to loop that do this
function CustomFunc() if game.Workspace.tehepicford.Head == nil then print("Nothing to remove...") else game.Workspace.tehepicford.Head:remove() end end
while wait(0.6) do CustomFunc() end |
|
|
| Report Abuse |
|
|
C0D3Y
|
  |
| Joined: 24 Jul 2010 |
| Total Posts: 1692 |
|
|
| 19 Feb 2012 05:49 PM |
p = game.Workspace:GetChildren() for i = 1, #p do if p[i].Name == "Color Brick(Map)" then rest of script here... |
|
|
| Report Abuse |
|
|
|
| 19 Feb 2012 05:53 PM |
So with this...
p = game.Workspace:GetChildren() for i = 1, #p do if p[i].Name == "Color Brick(Map)" then script.Parent.Adornee = script.Parent.Parent
local rainbow = {
BrickColor.new("Bright red"), BrickColor.new("Bright orange"), BrickColor.new("New Yeller"), BrickColor.new("Bright green"), BrickColor.new("Bright blue"), BrickColor.new("Lavender"), BrickColor.new("Bright violet"),
}
local thing = script.Parent local wt = .5
while true do wait() for i = 1, #rainbow do thing.Color = rainbow[i] wait(wt) end end end end
will that work for MULTIPLE bricks that are called "Color Brick(Map)"? Also, How would I add to this script to make it insert this script into a forcefield, which is in the brick? |
|
|
| Report Abuse |
|
|
| |
|
C0D3Y
|
  |
| Joined: 24 Jul 2010 |
| Total Posts: 1692 |
|
|
| 20 Feb 2012 09:25 AM |
| Yes that would work. I don't really know what you mean with the force field. |
|
|
| Report Abuse |
|
|
|
| 20 Feb 2012 09:34 AM |
| I did a script that was already in a block, but before I inserted a script I did Insert>Object>ForceField then put the script in it... |
|
|
| Report Abuse |
|
|
C0D3Y
|
  |
| Joined: 24 Jul 2010 |
| Total Posts: 1692 |
|
|
| 20 Feb 2012 09:36 AM |
| So you put the script in the ForceField? My part of the script would still work, not sure about yours though... |
|
|
| Report Abuse |
|
|
|
| 20 Feb 2012 09:42 AM |
would I be able to inesert one like this or something:
Instance.new(ForceField) or whatever? |
|
|
| Report Abuse |
|
|
C0D3Y
|
  |
| Joined: 24 Jul 2010 |
| Total Posts: 1692 |
|
|
| 20 Feb 2012 09:47 AM |
| Oh, that's what you mean. Yea, it would be Instance.new("ForceField", NameOfBrickHere) |
|
|
| Report Abuse |
|
|
|
| 20 Feb 2012 09:53 AM |
| ... Where in the script does it go? And would It put the script inside the forcefield that it inserts? |
|
|
| Report Abuse |
|
|
|
| 20 Feb 2012 09:58 AM |
the script would be inserted into Color Block(Map) as this:
Color Block(Map).Parent.Parent
and the *SelectionBox*(sorry my mistake) would be Color Block.Parent |
|
|
| Report Abuse |
|
|
|
| 20 Feb 2012 10:18 AM |
| So even without the selection box it will work? |
|
|
| Report Abuse |
|
|
|
| 20 Feb 2012 10:52 AM |
It doesn't work without the script that it inserts in a selection box... how would I do that?
In all parts named "Color Block(Map)" there needs to be a selection box, and in the selection box there needs to be this script:
script.Parent.Adornee = script.Parent.Parent
local rainbow = {
BrickColor.new("Bright red"), BrickColor.new("Bright orange"), BrickColor.new("New Yeller"), BrickColor.new("Bright green"), BrickColor.new("Bright blue"), BrickColor.new("Lavender"), BrickColor.new("Bright violet"),
}
local thing = script.Parent local wt = .5
while true do wait() for i = 1, #rainbow do thing.Color = rainbow[i] wait(wt) end end |
|
|
| Report Abuse |
|
|
|
| 20 Feb 2012 11:00 AM |
Bump
CMON PEOPLE!!!!!!!!!!! |
|
|
| Report Abuse |
|
|
|
| 20 Feb 2012 11:07 AM |
| !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!BUMP!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
|
|
| Report Abuse |
|
|