llcoolj03
|
  |
| Joined: 20 Nov 2011 |
| Total Posts: 6135 |
|
|
| 01 Oct 2014 01:47 AM |
player = script.Parent.Parent.Parent.Parent codeItem = game.ReplicatedStorage.Item1 codeBox = script.Parent function code() if codeBox.Text == "code1" then local a = codeItem:clone() a.Parent = player.Backpack end end What's wrong with it? |
|
|
| Report Abuse |
|
|
llcoolj03
|
  |
| Joined: 20 Nov 2011 |
| Total Posts: 6135 |
|
| |
|
| |
|
llcoolj03
|
  |
| Joined: 20 Nov 2011 |
| Total Posts: 6135 |
|
| |
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
| |
|
llcoolj03
|
  |
| Joined: 20 Nov 2011 |
| Total Posts: 6135 |
|
| |
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 01 Oct 2014 02:22 AM |
| 'Course it is. That's how you call code(), numnuts |
|
|
| Report Abuse |
|
|
llcoolj03
|
  |
| Joined: 20 Nov 2011 |
| Total Posts: 6135 |
|
|
| 01 Oct 2014 02:22 AM |
| How do I put it into the script? |
|
|
| Report Abuse |
|
|
|
| 01 Oct 2014 03:35 AM |
In order for a function to run, it must be called.
player = script.Parent.Parent.Parent.Parent codeItem = game.ReplicatedStorage.Item1 codeBox = script.Parent function code() if codeBox.Text == "code1" then local a = codeItem:clone() a.Parent = player.Backpack end end
code() --put this anywhere in your script to run the "code" function. |
|
|
| Report Abuse |
|
|
llcoolj03
|
  |
| Joined: 20 Nov 2011 |
| Total Posts: 6135 |
|
| |
|
llcoolj03
|
  |
| Joined: 20 Nov 2011 |
| Total Posts: 6135 |
|
| |
|
llcoolj03
|
  |
| Joined: 20 Nov 2011 |
| Total Posts: 6135 |
|
| |
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 02 Oct 2014 02:30 AM |
| Learn to Lua - knowing how to call a function is a very important part of any language, and a core part of anything you should be learning. |
|
|
| Report Abuse |
|
|
|
| 02 Oct 2014 03:28 AM |
| I'm a beginner, and none of the experts called it out, but I think you need to connect the function in order for it to work? |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 02 Oct 2014 05:13 AM |
| You don't need to connect to an event to call a function. |
|
|
| Report Abuse |
|
|