|
| 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 |
|
|
| |
|
|
| 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 |
|
|
|
| 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 |
|
|
| |
|
| |
|
| |
|
|
| 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 |
|
|