|
| 12 May 2013 11:47 PM |
| How am I able to check if a tool is dropped? It doesn't fire an event. |
|
|
| Report Abuse |
|
|
EliteDev
|
  |
| Joined: 10 Feb 2012 |
| Total Posts: 66 |
|
|
| 12 May 2013 11:50 PM |
If it's dropped it won't be in a user's backpack. So just check the backpack for the item, if it's not there, it's dropped. I think. |
|
|
| Report Abuse |
|
|
|
| 12 May 2013 11:50 PM |
tool = script.Parent
if tool.Parent.Name == "Workspace" then --stuff end |
|
|
| Report Abuse |
|
|
|
| 12 May 2013 11:51 PM |
| I am unable to use loops to check. |
|
|
| Report Abuse |
|
|
|
| 12 May 2013 11:53 PM |
| @Elite, when the tool is not equipped then it is in the backpack but if it is equipped, it is in the character, and if it is dropped then i think it is in the workspace. |
|
|
| Report Abuse |
|
|
EliteDev
|
  |
| Joined: 10 Feb 2012 |
| Total Posts: 66 |
|
|
| 12 May 2013 11:54 PM |
Oh, I guess you're right. If it's not in the backpack it's either equipped or dropped. But yeah, I think your way would work. |
|
|
| Report Abuse |
|
|
|
| 13 May 2013 12:49 AM |
| if your trying to make it so people can't drop a tool, check the "UnDroppable" box in the tool |
|
|
| Report Abuse |
|
|
|
| 13 May 2013 12:54 AM |
Use the event, :AncestryChanged() to fire a check to see if it's parented to a player or a model. If it's been dropped, then it will end up in Workspace unless you have a strange script that prevents it- which I highly doubt. So basically
tool = blahblah.Tool -- You better not just leave this or I'll prod your face with a rusty spoon. UNPLEASANTLY.
function onAncestryChanged() if tool.Parent == Workspace then tool:Destroy() end end
tool.AncestryChanged:connect(onAncestryChanged) |
|
|
| Report Abuse |
|
|