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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Gui Textbutton problem

Previous Thread :: Next Thread 
machokickface is not online. machokickface
Joined: 12 Aug 2010
Total Posts: 1774
11 Jun 2013 11:55 AM
Hello, I am having a problem. If I were to click a 'TextButton' how would I be able to
get a hat or gear that would get to my Character or my character's backpack.

function onClick()
Item=game:GetService("InsertService"):LoadAsset(118279889)
if Item:IsA("Hat")==true or Item:IsA("CharacterMesh") or Item:IsA("ShirtGraphic") then
Item.Parent=Player.Character
elseif Item:IsA("Tool")==true then
Item.Parent=player.Backpack
end
end
Item.Parent = workspace


script.Parent.MouseButton1Click:connect(onClick)
Report Abuse
killjoy37 is not online. killjoy37
Joined: 27 Aug 2008
Total Posts: 2821
11 Jun 2013 12:01 PM
Your event is wrong.

script.Parent.MouseButton1Click:connect(onClick)

should be

script.Parent.MouseButton1Down:connect(onClick)
Report Abuse
Scriptman8 is not online. Scriptman8
Joined: 25 Dec 2011
Total Posts: 5561
11 Jun 2013 12:02 PM
@Above,

MouseButton1Click is for a full Click.
Report Abuse
LifeIsUnfairReturns is not online. LifeIsUnfairReturns
Joined: 10 Mar 2012
Total Posts: 4612
11 Jun 2013 12:05 PM
MouseButton1Down is correct
What do you mean by a full click?
Report Abuse
killjoy37 is not online. killjoy37
Joined: 27 Aug 2008
Total Posts: 2821
11 Jun 2013 12:54 PM
Oh, that's right. I forgot about that one. There is an event with that name the fires when the mouse fully clicks, as in clicks down and releases up while still on the gui.
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