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 » Scripters
Home Search
 

Re: "Argument missing or nil"

Previous Thread :: Next Thread 
Pro_JC is online. Pro_JC
Joined: 08 Jul 2011
Total Posts: 2701
24 May 2017 05:01 PM
local Boat = script.Parent -- Creating a variable

Boat = Instance.new("Part"):WaitForChild()


Pineapples do not belong on Pizza
Report Abuse
Mister_Manakin is not online. Mister_Manakin
Joined: 16 Sep 2009
Total Posts: 1935
24 May 2017 05:02 PM
WaitForChild() requires a string as a parameter.
Report Abuse
Mister_Manakin is not online. Mister_Manakin
Joined: 16 Sep 2009
Total Posts: 1935
24 May 2017 05:03 PM
Even then it would return null since you're creating a new instance and not adding anything else to it.
Report Abuse
Jaidenati is online. Jaidenati
Joined: 10 Oct 2012
Total Posts: 192
24 May 2017 05:05 PM
Is the parent a model?

Try this:

local Boat

Boat = Instance.new("Part"):WaitForChild()


Report Abuse
Mister_Manakin is not online. Mister_Manakin
Joined: 16 Sep 2009
Total Posts: 1935
24 May 2017 05:07 PM
You
Need
A
Parameter
Report Abuse
Jaidenati is online. Jaidenati
Joined: 10 Oct 2012
Total Posts: 192
24 May 2017 05:07 PM
Haha oops. Wrong code.

local Boat = script.Parent -- Creating a variable

Boat = Instance.new("Part")


^ The above code should work.


Report Abuse
FumeiSencho is not online. FumeiSencho
Joined: 07 Apr 2013
Total Posts: 452
24 May 2017 05:08 PM
why the hell are you using WaitForChild, the instance is DEFINITELY there. you don't need to WaitForChild.


Report Abuse
Pro_JC is online. Pro_JC
Joined: 08 Jul 2011
Total Posts: 2701
24 May 2017 05:08 PM
local Boat = script.Parent

Boat = Instance.new("Part")

local Water = Boat:WaitForChild("Part")

-- Okay, I still have to look up what Parameter means. But I am just assuming that this is how I should do this.



Pineapples do not belong on Pizza
Report Abuse
Pro_JC is online. Pro_JC
Joined: 08 Jul 2011
Total Posts: 2701
24 May 2017 05:09 PM
I am having a lot of troubles. This is my 4th Week on learning Lua.


Pineapples do not belong on Pizza
Report Abuse
Mister_Manakin is not online. Mister_Manakin
Joined: 16 Sep 2009
Total Posts: 1935
24 May 2017 05:11 PM
What are you trying to do exactly?
Report Abuse
Pro_JC is online. Pro_JC
Joined: 08 Jul 2011
Total Posts: 2701
24 May 2017 05:15 PM
Well, my friend built this weird thing. Kinda looks like a boat. So I decided to play around with it by practicing my Lua skills. I wanted Water to appear at the bottom of the boat and then a While true do loop constantly play a rocking animation. It's simple. But the part of creating another part is the only problem I seem to be having.


Pineapples do not belong on Pizza
Report Abuse
Mister_Manakin is not online. Mister_Manakin
Joined: 16 Sep 2009
Total Posts: 1935
24 May 2017 05:19 PM
You could have something like:

local Boat = script.Parent -- this is the boat

local water = Instance.new("Part",Boat) -- inserts a new brick into the boat

"water" is now the reference variable for the water brick. You can do things like "water.Transparency = .5" and such to modify the properties to where you need it. WaitForChild() was not needed here because you now have a direct reference to the part.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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