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: Gui Help

Previous Thread :: Next Thread 
Hibobb is not online. 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 is not online. jobro13
Joined: 05 Aug 2009
Total Posts: 2865
26 May 2013 09:48 AM
game.PLayers <-----

read the output.
Report Abuse
Hibobb is not online. 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 is not online. Hibobb
Joined: 18 Apr 2010
Total Posts: 2146
26 May 2013 10:32 AM
bumpp
Report Abuse
bob354293 is not online. 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 is not online. Hibobb
Joined: 18 Apr 2010
Total Posts: 2146
26 May 2013 10:47 AM
thank you
Report Abuse
Hibobb is not online. 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 is not online. Hibobb
Joined: 18 Apr 2010
Total Posts: 2146
26 May 2013 11:55 AM
bump
Report Abuse
Hibobb is not online. Hibobb
Joined: 18 Apr 2010
Total Posts: 2146
27 May 2013 10:24 AM
bump bump
Report Abuse
noah is not online. 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
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