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 do I access the clicker of a GUI?

Previous Thread :: Next Thread 
icanxlr8 is not online. icanxlr8
Joined: 25 Feb 2009
Total Posts: 3686
06 Aug 2012 10:52 AM
I'm making a Class thing, and I need to access a clicker's backpack. What do I have to do?
Report Abuse
glosgreen2 is not online. glosgreen2
Joined: 06 Jul 2009
Total Posts: 1303
06 Aug 2012 10:55 AM
-- For use in a LocalScript
game.Players.LocalPlayer

-- Signature -------------
The Orange Juice said "Concentrate"... I did but nothing happened.
Report Abuse
icanxlr8 is not online. icanxlr8
Joined: 25 Feb 2009
Total Posts: 3686
06 Aug 2012 11:00 AM
So, if I put this {
local weapon = game.Lighting.Bow
local backpack = game.Players.LocalPlayer.Backpack
script.Parent.MouseButton1Down:connect(function()
weapon.Parent = backpack
end)
}
and it should work?
Report Abuse
glosgreen2 is not online. glosgreen2
Joined: 06 Jul 2009
Total Posts: 1303
06 Aug 2012 06:47 PM
Yeah. But, if you want to place a copy of the weapon, you should use:
local weapon = game.Lighting.Bow
local backpack = game.Players.LocalPlayer.Backpack
script.Parent.MouseButton1Down:connect(function()
weapon:Clone().Parent = backpack
end)

-- Info -----
User: glosgreen2
Time: 00:46
Date: 07/08/2012
Report Abuse
glosgreen2 is not online. glosgreen2
Joined: 06 Jul 2009
Total Posts: 1303
06 Aug 2012 06:48 PM
Just remember to use a LocalScript for this method to work.

local weapon = game.Lighting.Bow
local backpack = game.Players.LocalPlayer.Backpack
script.Parent.MouseButton1Click:connect(function()
weapon:Clone().Parent = backpack
end)

-- Info -----
User: glosgreen2
Time: 00:00
Date: 00/00/2012
Report Abuse
TheEpicSamuri is not online. TheEpicSamuri
Joined: 04 Dec 2011
Total Posts: 1343
06 Aug 2012 07:09 PM
script.Parent.MouseButton1Click:connect(function
local cloning = game.Lighting.RandomObject:Clone()
if LocalPlayer.Leaderstats >= 1000 then
cloning.Parent = LocalPlayer.Backpack
LocalPlayer.Leaderstats = 1000 - 700
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