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: Someday, Output, Someday I'll Get Rid of You.

Previous Thread :: Next Thread 
evilishnessII is not online. evilishnessII
Joined: 26 Mar 2011
Total Posts: 10275
30 Jun 2012 10:56 PM
Can someone PLEASE explain to me what a function argument is?

I thought it was like putting

X = script.Parent:Clone()
X.:Remove()

So, then, you put

X = script.Parent:Clone()
wait(5)
X.:Remove()

Right?

Still getting errors.

Help, please? I obviously have no idea what this means.

._.
Report Abuse
evilishnessII is not online. evilishnessII
Joined: 26 Mar 2011
Total Posts: 10275
30 Jun 2012 10:57 PM
[ X.:Remove() was supposed to be, both times, X:Remove() ]
Report Abuse
LordSiphon is not online. LordSiphon
Joined: 28 May 2012
Total Posts: 518
30 Jun 2012 10:58 PM
    X.:Remove() --Remove the period before the X and :... It should look like this

    X:Remove() or use :Destroy()

~Clans fall, people don't~
Report Abuse
evilishnessII is not online. evilishnessII
Joined: 26 Mar 2011
Total Posts: 10275
30 Jun 2012 11:00 PM
Thank you, but that was only a typo.

Although, I did check - I didn't do that on the script, itself.
Report Abuse
DXPower is not online. DXPower
Joined: 21 Oct 2008
Total Posts: 2866
30 Jun 2012 11:00 PM
Why are you using a period before your method? Never do that...

Remove the period before the colon (:).

Annoying the crap out of you, one word at a time. -Says suoicodilaipxecitsaligirfilacrepus repeatedly-
Report Abuse
LordSiphon is not online. LordSiphon
Joined: 28 May 2012
Total Posts: 518
30 Jun 2012 11:00 PM
I think you have to parent the cloned object first. So like this:

    X = script.Parent:clone().Parent = Workspace
    X:Remove()

~Clans fall, people don't~
Report Abuse
evilishnessII is not online. evilishnessII
Joined: 26 Mar 2011
Total Posts: 10275
30 Jun 2012 11:02 PM
No, no.

That can't be the problem.

Listen, guys - that was only an example.

What I really need to know, is, WHAT is a Function Argument?
Report Abuse
evilishnessII is not online. evilishnessII
Joined: 26 Mar 2011
Total Posts: 10275
30 Jun 2012 11:09 PM
[ Actual Cannibal, Shia Labeouf. ]
Report Abuse
LordSiphon is not online. LordSiphon
Joined: 28 May 2012
Total Posts: 518
30 Jun 2012 11:09 PM
Oooh! I don't understand it 100% from reading the wiki so I'll give you the link and try and explain the best I can.
http://wiki.roblox.com/index.php/Function#Using_Arguments_and_Parameters
So, you have a function and it's an onTouched script

function onTouched(hit)
The "hit" inside the () can be called later. That's what the argument is used for I believe. I'll give you an example script in the form of a player-kicker.

function PlayerAdded(player)
if player.Name == "evilishnessII" then
player:Destroy()
end
Players.PlayerAdded:connect(PlayerAdded)
I used "player" later on in the function to refer to the new player. It can be named other thing such as newplayer, plyer, ugadbskfa, etc.


~Clans fall, people don't~
Report Abuse
evilishnessII is not online. evilishnessII
Joined: 26 Mar 2011
Total Posts: 10275
30 Jun 2012 11:17 PM
[ Oh damn, wrong thread. ]

[ ._. ]

[ Erm - Sorry.. Heh. ]
Report Abuse
evilishnessII is not online. evilishnessII
Joined: 26 Mar 2011
Total Posts: 10275
30 Jun 2012 11:21 PM
[ Thanks! That really helped. :) ]
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