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: attempt to index local 'part' (a nil value)

Previous Thread :: Next Thread 
TheRedAngel is not online. TheRedAngel
Joined: 17 Apr 2012
Total Posts: 471
27 Jan 2013 09:50 AM
function removed(part,target)
if part.Name == "Left Leg" then--HERE
start(target,0,-2,-1)
end
end

workspace.ChildAdded:connect(function (add)
if add:findFirstChild("Humanoid") ~= nil then
add.Humanoid.Changed:connect(function () change(add) end)
add.ChildRemoved:connect(function () removed(part,add) end)
end
end)

i dont undestend whats wrong with it D:
Report Abuse
Woodstauk4 is not online. Woodstauk4
Joined: 27 Dec 2010
Total Posts: 3061
27 Jan 2013 09:51 AM
function removed(part,target)
if part.Name == "Left Leg" then--HERE
start(target,0,-2,-1)
end
end

workspace.ChildAdded:connect(function (add)
if add:findFirstChild("Humanoid") ~= nil then
add.Humanoid.Changed:connect(function () change(add) end)
add.ChildRemoved:connect(removed(part,add))
end
end)
Report Abuse
Combrad is not online. Combrad
Joined: 18 Jul 2009
Total Posts: 11025
27 Jan 2013 09:52 AM
Can you paste what start() is?
Report Abuse
TheRedAngel is not online. TheRedAngel
Joined: 17 Apr 2012
Total Posts: 471
27 Jan 2013 09:54 AM
Woodstauk4, im still getting the error :c
Report Abuse
Combrad is not online. Combrad
Joined: 18 Jul 2009
Total Posts: 11025
27 Jan 2013 09:55 AM
Woodstauk didn't fix your script.
Can you paste the whole script?
Or EVERYTHING that is relevant to that section.
Report Abuse
Woodstauk4 is not online. Woodstauk4
Joined: 27 Dec 2010
Total Posts: 3061
27 Jan 2013 09:56 AM
sajdhwenjfd


function removed(part,target)
if part.Name == "Left Leg" then--HERE
start(target,0,-2,-1)
end
end

workspace.ChildAdded:connect(function (add)
if add:findFirstChild("Humanoid") ~= nil then
add.Humanoid.Changed:connect(function () change(add) end)
add.ChildRemoved:connect(removed)
end
end)
Report Abuse
Combrad is not online. Combrad
Joined: 18 Jul 2009
Total Posts: 11025
27 Jan 2013 09:57 AM
That should fix it, not how I would of done it though.
Report Abuse
TheRedAngel is not online. TheRedAngel
Joined: 17 Apr 2012
Total Posts: 471
27 Jan 2013 09:59 AM
now there is no error but it wont do anything, ill see if i can figer it out, thanks btw :D
Report Abuse
ArceusInator is not online. ArceusInator
Joined: 10 Oct 2009
Total Posts: 30553
27 Jan 2013 10:22 AM
add.ChildRemoved:connect(function () removed(part,add) end)

On this line, you make a reference to "part" for the first time. You never defined it.
Report Abuse
ArceusInator is not online. ArceusInator
Joined: 10 Oct 2009
Total Posts: 30553
27 Jan 2013 10:23 AM
I think what you meant to do was

add.ChildRemoved:connect(function (part) removed(part,add) end)
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