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: Brick Command...

Previous Thread :: Next Thread 
VictoriousMaxPower is not online. VictoriousMaxPower
Joined: 14 Jan 2010
Total Posts: 841
12 Jul 2011 07:19 AM
Okay, so I have around 50 bricks in my Model named Part. I now want to make it so I only ahve to do one line of Scripting to effect all of them... Would [blah blah blah].Part.Anchored = false work on all of them or would I have to do something different (I can't test 'cause I'm on my sisters laptop...) ?
Report Abuse
PompeyTheGreat is not online. PompeyTheGreat
Joined: 10 Apr 2011
Total Posts: 5615
12 Jul 2011 07:36 AM
for _, v in pairs(model:children()) do
--Do stuff to bricks
end
Report Abuse
VictoriousMaxPower is not online. VictoriousMaxPower
Joined: 14 Jan 2010
Total Posts: 841
12 Jul 2011 07:37 AM
Okay thanks :)
Report Abuse
VictoriousMaxPower is not online. VictoriousMaxPower
Joined: 14 Jan 2010
Total Posts: 841
12 Jul 2011 07:44 AM
o.o
It didn't work...
Report Abuse
myrco919 is not online. myrco919
Joined: 12 Jun 2009
Total Posts: 13241
12 Jul 2011 07:47 AM
[ Content Deleted ]
Report Abuse
VictoriousMaxPower is not online. VictoriousMaxPower
Joined: 14 Jan 2010
Total Posts: 841
12 Jul 2011 07:57 AM
local isOn = false
model = script.Parent.Debris

function on()
isOn = true
wait()
for _, v in pairs(model:children()) do
Transparency = 0
Anchored = false
end
end


function off()
isOn = false
wait()
for _, v in pairs(model:children()) do
Transparency = 1
Anchored = true
end
end

function onChatted(msg, speaker)
if msg:lower() == "debris" then do
if isOn == true then off() else on()
end
end
end
end

game.Players.PlayerAdded:connect(function(player)
if player:IsInGroup(106362) then
player.Chatted:connect(function(msg) onChatted(msg, newPlayer) end)
end end)



Doesn't work, yet the Output has come up with no errors...
Report Abuse
myrco919 is not online. myrco919
Joined: 12 Jun 2009
Total Posts: 13241
12 Jul 2011 07:59 AM
[ Content Deleted ]
Report Abuse
VictoriousMaxPower is not online. VictoriousMaxPower
Joined: 14 Jan 2010
Total Posts: 841
12 Jul 2011 08:08 AM
Ohh, thanks! I've never used pairs before...
Report Abuse
myrco919 is not online. myrco919
Joined: 12 Jun 2009
Total Posts: 13241
12 Jul 2011 08:09 AM
[ Content Deleted ]
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