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: (Function(key) For a specific tool in backpack? [Help]

Previous Thread :: Next Thread 
ShiveringBullet is online. ShiveringBullet
Joined: 05 Aug 2012
Total Posts: 159
07 Aug 2014 01:25 PM
I currently made a (Function(key) that would Find a tool in the lightning if you pressed a key,

p = game.Players.LocalPlayer
m = p:GetMouse()
repeat wait() until p.Character
c = p.Character
m.KeyDown:connect(function(key)
if key == "m" and not c:findFirstChild("Tool") then
game.Lighting.Tool:clone().Parent = c
end
end)

However,
How would I make it so if I press maybe (M), It would select the first tool in your backpack instead of looking for the "tool" in the lightning?
Report Abuse
ShiveringBullet is online. ShiveringBullet
Joined: 05 Aug 2012
Total Posts: 159
07 Aug 2014 02:46 PM
BUMP
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
07 Aug 2014 02:48 PM
p = game.Players.LocalPlayer
m = p:GetMouse()
repeat wait() until p.Character
c = p.Character
m.KeyDown:connect(function(key)
if key == "m" and not c:findFirstChild("Tool") then
c.Humanoid:EquipTool(p.Backpack:GetChildren()[1])
end
end)
Report Abuse
ShiveringBullet is online. ShiveringBullet
Joined: 05 Aug 2012
Total Posts: 159
07 Aug 2014 04:41 PM
This only handsomely chooses a tool in the player's backpack instead of "Tool 1", And you can't unequipped it if you press m back, Thanks for trying though,
Report Abuse
BlackHoleGame is not online. BlackHoleGame
Joined: 02 Jun 2013
Total Posts: 1
07 Aug 2014 04:43 PM
key:lower()
Report Abuse
ShiveringBullet is online. ShiveringBullet
Joined: 05 Aug 2012
Total Posts: 159
07 Aug 2014 05:11 PM
Doesn't work,
Report Abuse
ShiveringBullet is online. ShiveringBullet
Joined: 05 Aug 2012
Total Posts: 159
10 Aug 2014 06:12 PM
Bump.
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
10 Aug 2014 06:28 PM
Specifically "Tool 1"?

p = game.Players.LocalPlayer
m = p:GetMouse()
repeat wait() until p.Character
c = p.Character
m.KeyDown:connect(function(key)
if key == "m" then
if not c:findFirstChild("Tool 1") and p.Backpack:FindFirstChild("Tool 1") then
c.Humanoid:EquipTool(p.Backpack["Tool 1"])
elseif c:findFirstChild("Tool 1") then
c.Humanoid:UnequipTools()
end
end
end)
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