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
 

Why isn't this working?

Previous Thread :: Next Thread 
korky5000 is not online. korky5000
Joined: 20 Aug 2008
Total Posts: 228
08 Feb 2013 12:07 PM
function onTouched (part)
h = part.Parent:findFirstChild("Humanoid")
if (h ~= nil) then
h.Backpack:GetChildren()
remove()

end
end
script.Parent.Touched:connect(onTouched)

It says line 2 in my output. I can't figure it out.
Report Abuse
CaptainSandbox is not online. CaptainSandbox
Joined: 08 Oct 2012
Total Posts: 908
08 Feb 2013 01:30 PM
function onTouch(part)

local Humanoid = part.Parent:FindFirstChild("Humanoid")

if Humanoid ~= nil then

for Tool = 1, #game.Players[Humanoid.Parent.Name].Backpack:getChildren() do

game.Players[Humanoid.Parent.Name].Backpack:getChildren()[Tool]:Destroy()

end

end

end

script.Parent.Touched:connect(onTouch)
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