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: Humanoid:EquipTool()

Previous Thread :: Next Thread 
UnRandomizing is not online. UnRandomizing
Joined: 20 Jun 2012
Total Posts: 1490
09 Apr 2017 06:43 PM
I have a localscript inside a GUI that detects when the player presses '1'. This script has this line of code in it:

local sword = script.Parent.Slot1.Tool.Tool:Clone()
player.Character.Humanoid:EquipTool(sword)

And the sword does appear, but drops on the floor. The player still has his/her arm up as if he/she was holding it. When the sword was in StarterPack, it worked fine. Any ideas on why the the sword(Tool.Handle) keeps dropping? How can I fix this?
Report Abuse
CassiusLincoln is online. CassiusLincoln
Joined: 11 Jul 2010
Total Posts: 121
09 Apr 2017 06:55 PM
Does the same thing happen in studio, and in game. Or are you getting different results?


Report Abuse
UnRandomizing is not online. UnRandomizing
Joined: 20 Jun 2012
Total Posts: 1490
09 Apr 2017 06:59 PM
In Studio, it works perfectly fine, you can equip the sword and it actually appears in your hand. In game, however, the tool appears in the air, dropping to the baseplate. No matter how many times you re-equip, the tool will always end up in the same location.
Report Abuse
UnRandomizing is not online. UnRandomizing
Joined: 20 Jun 2012
Total Posts: 1490
09 Apr 2017 07:15 PM
Nevermind, I fixed this by putting the clone of the sword in the player's avatar...

local sword = script.Parent.Slot1.Tool.Tool:Clone()
sword.Parent = player.Character --for some reason this fixes it
player.Character.Humanoid:EquipTool(sword)
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