|
| 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
|
  |
| 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 |
|
|
|
| 11 Jun 2013 12:02 PM |
@Above,
MouseButton1Click is for a full Click. |
|
|
| Report Abuse |
|
|
|
| 11 Jun 2013 12:05 PM |
MouseButton1Down is correct What do you mean by a full click? |
|
|
| Report Abuse |
|
|
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 |
|
|