|
| 11 Jul 2014 09:29 PM |
I built a tool, but for the life of me I can't figure out how to write a working script that removes it from the player's backpack after it is used.
I basically heavily edited a gear so that a squirrel follows you around, but I want it to be single use.
Would someone mind writing me a script that would remove it from the player's backpack (not starterpack) after use? I know you guys don't like just forking over scripts but I figure this has to be incredibly simple, even though my attempts are failing |
|
|
| Report Abuse |
|
|
| |
|
|
| 11 Jul 2014 09:38 PM |
This has to be such a simple script, right?
Something like...? That was my best shot, you can see I'm not very good at this.
function onButton1Down(mouse) Tool:Remove() end
|
|
|
| Report Abuse |
|
|
sbk28
|
  |
| Joined: 15 Nov 2008 |
| Total Posts: 2528 |
|
|
| 11 Jul 2014 09:39 PM |
tool.Activated:connect(function() tool:Destroy() end |
|
|
| Report Abuse |
|
|
sbk28
|
  |
| Joined: 15 Nov 2008 |
| Total Posts: 2528 |
|
|
| 11 Jul 2014 09:39 PM |
tool.Activated:connect(function() tool:Destroy() end)
*
my bad missed a bracket |
|
|
| Report Abuse |
|
|
|
| 11 Jul 2014 09:42 PM |
That doesn't seem to work sbk. I'm just inserting a script into the tool and adding those 3 lines of script, is there some other place/way I have to insert the script? |
|
|
| Report Abuse |
|
|
sbk28
|
  |
| Joined: 15 Nov 2008 |
| Total Posts: 2528 |
|
|
| 11 Jul 2014 09:44 PM |
if it's inside the tool
script.Parent.Activated:connect(function() script.Parent:Destroy() end) |
|
|
| Report Abuse |
|
|
|
| 11 Jul 2014 09:47 PM |
That makes sense.
Perfect. Thank you so much. |
|
|
| Report Abuse |
|
|