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
 

"child" a nil value (child.Touched:connect(onTouched))

Previous Thread :: Next Thread 
Club24Hour is not online. Club24Hour
Joined: 23 Oct 2011
Total Posts: 1795
28 Jul 2014 09:29 PM

function onTouched(hit)
if(hit.Parent:FindFirstChild("Humanoid") == nil) then
return
end
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
teamcolor = player.TeamColor

child.BrickColor = BrickColor.new(teamcolor)






end
game.Workspace.Map:getChildren()
child.Touched:connect(onTouched)


Report Abuse
phoenix53124 is not online. phoenix53124
Joined: 25 Feb 2009
Total Posts: 4889
28 Jul 2014 09:35 PM
Child is not declared when you try to apply 'Touched'
Report Abuse
Club24Hour is not online. Club24Hour
Joined: 23 Oct 2011
Total Posts: 1795
28 Jul 2014 09:46 PM
for i,v in next, game.Workspace.Map:GetChildren() do
function onTouched(hit)
if(hit.Parent:FindFirstChild("Humanoid") == nil) then
return
end
local player = game.Players:GetPlayerFromCharacter(hit.Parent)
teamcolor = player.TeamColor

v.BrickColor = BrickColor.new(teamcolor)





end
end

v.Touched:connect(onTouched)
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