|
| 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 |
|
|
|
| 30 Jun 2012 10:57 PM |
| [ X.:Remove() was supposed to be, both times, X:Remove() ] |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 30 Jun 2012 11:09 PM |
| [ Actual Cannibal, Shia Labeouf. ] |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 30 Jun 2012 11:17 PM |
[ Oh damn, wrong thread. ]
[ ._. ]
[ Erm - Sorry.. Heh. ] |
|
|
| Report Abuse |
|
|
|
| 30 Jun 2012 11:21 PM |
| [ Thanks! That really helped. :) ] |
|
|
| Report Abuse |
|
|