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: Argument 1 missing or nil

Previous Thread :: Next Thread 
dmjoe is not online. dmjoe
Joined: 01 May 2009
Total Posts: 2387
29 Nov 2012 05:19 PM
taco = cheese:FindFirstChild()
local ponies = taco:GetChildren()
for i = 1,#ponies do
if ponies.ClassName == "Script" then
ponies:Remove()
if ponies.ClassName == "LocalScript" then
ponies:Remove()
end
end
end

What's wrong with this?
'Cheese' is a model with a tool inside of it.
Output: Argument 1 missing or nil.
Report Abuse
dmjoe is not online. dmjoe
Joined: 01 May 2009
Total Posts: 2387
29 Nov 2012 05:21 PM
(The first child of cheese will always be a tool)
Report Abuse
swimguy777 is not online. swimguy777
Joined: 30 May 2009
Total Posts: 17092
29 Nov 2012 05:23 PM
You never told FindFirstChild() what to find.

-[::ƧѡÎḾḠΰῩ::]-[::Helper of Scripting and Writer of Wikis::]-
Report Abuse
dmjoe is not online. dmjoe
Joined: 01 May 2009
Total Posts: 2387
29 Nov 2012 05:40 PM
I want it to find whatever is there.
The tool's name differentiates.
Report Abuse
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
29 Nov 2012 05:47 PM
If it's always the first thing, couldn't you be like.
taco = cheese[1]--? O: Idunno
Report Abuse
ScrewDeath is not online. ScrewDeath
Joined: 03 Jun 2012
Total Posts: 2700
29 Nov 2012 05:49 PM
Nu wait that won't work... :c
taca = cheese:GetChildren()
taco = taca[1]
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
29 Nov 2012 05:51 PM


    taco = cheese:FindFirstChild()[1]
    local ponies = taco:GetChildren()
  
    for i, v in pairs(ponies) do
      if v:IsA("Script") or v:IsA("LocalScript") then
        v:Destroy()
      end
    end

¤¤ †KMXD† ¤¤
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
29 Nov 2012 05:54 PM
Ah, yes, :GetChildren(), not :FindFirstChild().

¤¤ †KMXD† ¤¤
Report Abuse
miniTeam is not online. miniTeam
Joined: 28 Oct 2012
Total Posts: 27
29 Nov 2012 06:14 PM
Idiot.
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