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 » Scripters
Home Search
 

Re: force de-equipping of a tool?

Previous Thread :: Next Thread 
PandaDemic is not online. PandaDemic
Joined: 21 Jan 2011
Total Posts: 13422
21 Mar 2017 02:26 PM
im making # ## arena, when you TP to spawn i had it clear player backpack however if you're currently holding the sword, it wont be cleared. is there any way to force de-equipping of an item? are you not ENTERTAINED!??!
Report Abuse
PandaDemic is not online. PandaDemic
Joined: 21 Jan 2011
Total Posts: 13422
21 Mar 2017 02:27 PM
grr

*im making a sword fight arena
when you TP to spawn i had it clear player backpack
however if you're currently holding the sword, it wont be cleared. is there any way to force de-equipping of an item?


are you not ENTERTAINED!??!
Report Abuse
IcedVapour is not online. IcedVapour
Joined: 10 Nov 2013
Total Posts: 2741
21 Mar 2017 02:27 PM
Humanoid:UnequipTools()
Report Abuse
Gomlsauresrex is not online. Gomlsauresrex
Joined: 25 Mar 2016
Total Posts: 3588
21 Mar 2017 02:27 PM
If a player equips a tool it will be parented to their character.

Find the character and then destroy it.
Report Abuse
Gomlsauresrex is not online. Gomlsauresrex
Joined: 25 Mar 2016
Total Posts: 3588
21 Mar 2017 02:28 PM
Find the tool in their character*

The problem is I type too fast.
Report Abuse
PandaDemic is not online. PandaDemic
Joined: 21 Jan 2011
Total Posts: 13422
21 Mar 2017 02:28 PM
thanks! was certain there had to be a way to do it, just didn't know the function


are you not ENTERTAINED!??!
Report Abuse
IcedVapour is not online. IcedVapour
Joined: 10 Nov 2013
Total Posts: 2741
21 Mar 2017 02:28 PM
Humanoid:UnequipTools is a better solution
Report Abuse
PandaDemic is not online. PandaDemic
Joined: 21 Jan 2011
Total Posts: 13422
21 Mar 2017 02:34 PM
did not use humanoid:unequip tools
however used the removal method, did work.
source:

function onTouch(hit)
local humanoid = hit.Parent:FindFirstChild("Humanoid")
if (humanoid ~= nil) then
if (humanoid.Parent.LinkedSword ~= nil) then
humanoid.Parent.LinkedSword:Destroy()
end
end
end

script.Parent.Touched:connect(onTouch)


are you not ENTERTAINED!??!
Report Abuse
IcedVapour is not online. IcedVapour
Joined: 10 Nov 2013
Total Posts: 2741
21 Mar 2017 02:35 PM
If you destroy the tool u wont be able to use it again
Report Abuse
PandaDemic is not online. PandaDemic
Joined: 21 Jan 2011
Total Posts: 13422
21 Mar 2017 02:39 PM
ill explain why i did that

basically, my game is a sword arena. there is a teleporter from the "observer deck" to the arena itself.
teleporting to the arena grants you a sword. teleporting from it completely removes it from your inventory, to avoid spawnkillers.

i originally had trouble because i didnt know that equipped weapons were parented to character.


are you not ENTERTAINED!??!
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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