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: Check if tool is dropped

Previous Thread :: Next Thread 
Destiny1147 is not online. Destiny1147
Joined: 08 Jun 2011
Total Posts: 699
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 is not online. 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
Mikenberg123 is not online. Mikenberg123
Joined: 18 Jan 2011
Total Posts: 2099
12 May 2013 11:50 PM
tool = script.Parent

if tool.Parent.Name == "Workspace" then
--stuff
end
Report Abuse
Destiny1147 is not online. Destiny1147
Joined: 08 Jun 2011
Total Posts: 699
12 May 2013 11:51 PM
I am unable to use loops to check.
Report Abuse
Mikenberg123 is not online. Mikenberg123
Joined: 18 Jan 2011
Total Posts: 2099
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 is not online. 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
masterblokz is not online. masterblokz
Joined: 17 Nov 2010
Total Posts: 9517
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
DaneelOlivaw is online. DaneelOlivaw
Joined: 14 Apr 2012
Total Posts: 661
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
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