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 u no work!

Previous Thread :: Next Thread 
lordyoman is not online. lordyoman
Joined: 10 Jun 2010
Total Posts: 426
12 Jul 2012 08:27 AM
model = script.Parent

for _,v in pairs(model:GetChildren()) do
if v:IsA("BasePart") then
v.Touched:connect(function(part)
if not part:IsDescendantOf(model) then
if (part.Name == Bullet) and (script.Parent.Health.Value > 0) then
script.Parent.Health.Value = script.Parent.Health.Value - 2
end
end
end)
end
end


Sorry there is no output!
Report Abuse
TehChikenHater is not online. TehChikenHater
Joined: 11 Jun 2012
Total Posts: 497
12 Jul 2012 08:31 AM
model = script.Parent
for _,v in pairs(model:GetChildren()) do
if v:IsA("BasePart") then
v.Touched:connect(function(part)
if not part:IsDescendantOf(model) then
if (part.Name == "Bullet") and (script.Parent.Health.Value ​> 0) then
script.Parent.Health.Value = script.Parent.Health.Value - 2
end
end
end)
end
end

You should really learn to put ""'s around your names. :P

--TehChikenHater ლ(ಠ_ಠლ)
Report Abuse
lordyoman is not online. lordyoman
Joined: 10 Jun 2010
Total Posts: 426
12 Jul 2012 08:35 AM
Haha wow... Thanks for the help!
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