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: How would I do this?

Previous Thread :: Next Thread 
ImmortalMiner is not online. ImmortalMiner
Joined: 28 Jun 2011
Total Posts: 658
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
tehepicford is not online. tehepicford
Joined: 26 Aug 2011
Total Posts: 1486
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 is not online. 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
ImmortalMiner is not online. ImmortalMiner
Joined: 28 Jun 2011
Total Posts: 658
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
ImmortalMiner is not online. ImmortalMiner
Joined: 28 Jun 2011
Total Posts: 658
20 Feb 2012 09:24 AM
bump
Report Abuse
C0D3Y is not online. 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
ImmortalMiner is not online. ImmortalMiner
Joined: 28 Jun 2011
Total Posts: 658
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 is not online. 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
ImmortalMiner is not online. ImmortalMiner
Joined: 28 Jun 2011
Total Posts: 658
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 is not online. 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
ImmortalMiner is not online. ImmortalMiner
Joined: 28 Jun 2011
Total Posts: 658
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
ImmortalMiner is not online. ImmortalMiner
Joined: 28 Jun 2011
Total Posts: 658
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
ImmortalMiner is not online. ImmortalMiner
Joined: 28 Jun 2011
Total Posts: 658
20 Feb 2012 10:18 AM
So even without the selection box it will work?
Report Abuse
ImmortalMiner is not online. ImmortalMiner
Joined: 28 Jun 2011
Total Posts: 658
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
ImmortalMiner is not online. ImmortalMiner
Joined: 28 Jun 2011
Total Posts: 658
20 Feb 2012 11:00 AM
Bump

CMON PEOPLE!!!!!!!!!!!
Report Abuse
ImmortalMiner is not online. ImmortalMiner
Joined: 28 Jun 2011
Total Posts: 658
20 Feb 2012 11:07 AM
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!BUMP!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
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