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: Why wont this work?

Previous Thread :: Next Thread 
hovertank7 is not online. hovertank7
Joined: 15 Nov 2008
Total Posts: 178
30 Aug 2013 04:27 AM
I want it so that when the part is touched it will fall over.

larm = script.Parent:FindFirstChild("Left Arm")
rarm = script.Parent:FindFirstChild("Right Arm")
lleg = script.Parent:FindFirstChild("Left Leg")
rleg = script.Parent:FindFirstChild("Right Leg")

function OnTouched(hit)
if hit.Destroyable == true then
hit.Anchored = false
end
end



script.Parent.Head.Touched:connect(OnTouched)
larm.Touched:connect(OnTouched)
rarm.Touched:connect(OnTouched)
lleg.Touched:connect(OnTouched)
rleg.Touched:connect(OnTouched)
script.Parent.Torso.Touched:connect(OnTouched)
Report Abuse
Infocus is not online. Infocus
Joined: 28 Apr 2011
Total Posts: 8022
30 Aug 2013 04:57 AM
I dont get this

for _, v in pairs (game.Players.LocalPlayer.Character:children()) do
if v:IsA("Part") then
v.Touched:connect(function(hit)
if hit and hit.Name == "Destroyable" then
hit.Anchored = false
end
end)
end
end
Report Abuse
hovertank7 is not online. hovertank7
Joined: 15 Nov 2008
Total Posts: 178
30 Aug 2013 05:03 AM
Its because i have a giant zombie and i want it to knock parts over but only if they are marked as destroyable or else it would delete the base plate and other important things. But when it walks into the thing it just walks over it.
Report Abuse
xxBsFxx is not online. xxBsFxx
Joined: 26 Aug 2013
Total Posts: 3281
30 Aug 2013 05:54 AM
[ Content Deleted ]
Report Abuse
Infocus is not online. Infocus
Joined: 28 Apr 2011
Total Posts: 8022
30 Aug 2013 06:11 AM
^

Im aware of that, but why would I use GetChildren() when I can use :children(), besides the fact that its deprecated and will not likely be removed. (Not for a while anyways)
Report Abuse
IamAwesome777 is not online. IamAwesome777
Joined: 18 Jul 2011
Total Posts: 2640
30 Aug 2013 06:15 AM
It is better to use GetChildren, because it is more efficient for newer work.

children() still works, but Sorcus was talking about removing deprecated items in the near future.
Report Abuse
Infocus is not online. Infocus
Joined: 28 Apr 2011
Total Posts: 8022
30 Aug 2013 06:18 AM
Im doing fine with it. I refuse into typing more until I learn my lesson.
Report Abuse
IamAwesome777 is not online. IamAwesome777
Joined: 18 Jul 2011
Total Posts: 2640
30 Aug 2013 06:22 AM
My typing is fast enough for me not to notice 3 extra key presses.
Report Abuse
Infocus is not online. Infocus
Joined: 28 Apr 2011
Total Posts: 8022
30 Aug 2013 06:25 AM
:o
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