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: How would I...

Previous Thread :: Next Thread 
Imacheeseburger is not online. Imacheeseburger
Joined: 16 Jun 2011
Total Posts: 142
30 May 2014 07:37 PM
How would I change a sword's parent to Workspace, and then back to the player so they can re-equip the weapon? My hotkey system won't work without unequipping and re-equipping it, so I figured I'd automate it to make it less of a pain.
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
30 May 2014 07:40 PM
I recently made a quick one.

Just use

Humanoid:EquipTool(Instance Tool)

and

Humanoid:UnequipTools()
Report Abuse
Imacheeseburger is not online. Imacheeseburger
Joined: 16 Jun 2011
Total Posts: 142
30 May 2014 07:41 PM
No, by unequipping and re-equipping, I meant dropping it and picking it up. That won't do.
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
30 May 2014 07:44 PM
Well that's how you would Equip/Unequip... If you have to drop/pick it up manually it's not automatic? Also, why does your script require this?
Report Abuse
Imacheeseburger is not online. Imacheeseburger
Joined: 16 Jun 2011
Total Posts: 142
30 May 2014 07:47 PM
I know, that's the point -- I want to automate dropping and picking it up. I have no clue why my script requires this, but I've made like ten different scripts and none seem to work for my issue.
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
30 May 2014 07:49 PM
Oh, Unequip won't help you with that. Can't you set the parent and use EquipTool() though? Also, if you post the script, we might be able to figure out why it has this dependency.
Report Abuse
Imacheeseburger is not online. Imacheeseburger
Joined: 16 Jun 2011
Total Posts: 142
30 May 2014 07:52 PM
Normally, I'd post the script, but if I do that, I'd be publicly sharing a script that took me a RIDICULOUSLY long time to write from scratch. Also, if I set the parent to Workspace, I have no way of accessing the player's Humanoid to use the EquipTool method, since LocalPlayer won't work anymore once it's in Workspace.
Report Abuse
Imacheeseburger is not online. Imacheeseburger
Joined: 16 Jun 2011
Total Posts: 142
30 May 2014 07:55 PM
Bump-a-dump.
Report Abuse
Imacheeseburger is not online. Imacheeseburger
Joined: 16 Jun 2011
Total Posts: 142
30 May 2014 08:02 PM
Come on, seriously? People who join my game are like, "wtf tis game sux i cant uss my sord". HALP!
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
30 May 2014 08:05 PM
So in a localscript?

local Player = Game.Players.LocalPlayer

local Tool =

Tool.Parent = Workspace

Player.Character.Humanoid:EquipTool(Tool)

Or what's the setup?
Report Abuse
Imacheeseburger is not online. Imacheeseburger
Joined: 16 Jun 2011
Total Posts: 142
30 May 2014 08:06 PM
I'll try, but I don't think that'll work as once the tool is in Workspace, LocalPlayer no longer exists as a variable. If it does, it's a ROBLOX time bug.
Report Abuse
Imacheeseburger is not online. Imacheeseburger
Joined: 16 Jun 2011
Total Posts: 142
30 May 2014 09:01 PM
<3 ROBLOX time bugs. Thank you. If you want to test the place, it's at:
http://www.roblox.com/BLEACH-place?id=61511883
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