Hibobb
|
  |
| Joined: 18 Apr 2010 |
| Total Posts: 2146 |
|
|
| 26 May 2013 09:47 AM |
I need help with this script. Upon clicking a GUI it opens up a new one and removes the weapon in the Player's backpack. It is in a LocalScript. Any help will be much appreciated.
function clicked() game.PLayers.LocalPlayer.BackPack:FindFirstChild("Tool") --Removes the Tool it finds game.Lighting.AssualtC:Clone().Parent = game.Players.LocalPlayer.PlayerGui end
script.Parent.MouseButton1Down:connect(clicked)
|
|
|
| Report Abuse |
|
|
jobro13
|
  |
| Joined: 05 Aug 2009 |
| Total Posts: 2865 |
|
|
| 26 May 2013 09:48 AM |
game.PLayers <-----
read the output. |
|
|
| Report Abuse |
|
|
Hibobb
|
  |
| Joined: 18 Apr 2010 |
| Total Posts: 2146 |
|
|
| 26 May 2013 09:50 AM |
| No, I need help on what to put into the line after it locates the tool. |
|
|
| Report Abuse |
|
|
Hibobb
|
  |
| Joined: 18 Apr 2010 |
| Total Posts: 2146 |
|
| |
|
bob354293
|
  |
| Joined: 26 Oct 2008 |
| Total Posts: 2609 |
|
|
| 26 May 2013 10:35 AM |
function clicked() local tool = game.Players.LocalPlayer.BackPack:FindFirstChild("Tool") tool:remove() game.Lighting.AssualtC:Clone().Parent = game.Players.LocalPlayer.PlayerGui end |
|
|
| Report Abuse |
|
|
Hibobb
|
  |
| Joined: 18 Apr 2010 |
| Total Posts: 2146 |
|
| |
|
Hibobb
|
  |
| Joined: 18 Apr 2010 |
| Total Posts: 2146 |
|
|
| 26 May 2013 10:52 AM |
It gives me this error message:
11:53:28.537 - Players.Player1.PlayerGui.ChooseClass.TextButton.LocalScrip:3: attempt to index local 'tool' (a nil value) 11:53:28.538 - Script "Players.Player1.PlayerGui.ChooseClass.TextButton.LocalScrip", Line 3 11:53:28.540 - stack end 11:53:28.557 - Disconnected event because of exception |
|
|
| Report Abuse |
|
|
Hibobb
|
  |
| Joined: 18 Apr 2010 |
| Total Posts: 2146 |
|
| |
|
Hibobb
|
  |
| Joined: 18 Apr 2010 |
| Total Posts: 2146 |
|
| |
|
noah
|
  |
| Joined: 11 Sep 2006 |
| Total Posts: 18977 |
|
|
| 27 May 2013 10:55 AM |
player = game.Players.LocalPlayer
function clicked() tool = player.BackPack:FindFirstChild("Tool") if tool then tool:Destroy() wait(0.5) game.Lighting:findFirstChild("AssualtC"):Clone().Parent = player.PlayerGui end end
script.Parent.MouseButton1Down:connect(clicked) |
|
|
| Report Abuse |
|
|