|
| 21 Jan 2015 01:48 PM |
| So I have a gun, and I use the .Equipped and .Unequipped events to trigger the mouse's icon changing, but the problem is when the gun goes away from a script removing it, the icon stays. How can I remove the icon when the gun gets removed from the players inventory? |
|
|
| Report Abuse |
|
|
cala13er
|
  |
| Joined: 07 Feb 2010 |
| Total Posts: 191 |
|
|
| 21 Jan 2015 02:06 PM |
| You can't without a hopper bin or tool. The mouse icon is locked for some silly reason. |
|
|
| Report Abuse |
|
|
|
| 21 Jan 2015 03:28 PM |
| I'm using a tool for the gun though. I'm not sure you understand my question... I'm using a tool for a gun, and I have the mouse icon change when you equip/unequip. The issue is that removing the gun doesn't fire the unequipped event, thus making the icon stay after the gun is removed. |
|
|
| Report Abuse |
|
|
|
| 21 Jan 2015 04:05 PM |
| I thought that the icon staying after putting a item away was a glitch? |
|
|
| Report Abuse |
|
|
|
| 21 Jan 2015 06:23 PM |
| If you are changing the Icon of the mouse using the Icon property, you can reset the mouse to its default Icon by setting Icon to an empty string "". Do this on your unequipped event and you should be good to go. |
|
|
| Report Abuse |
|
|
|
| 21 Jan 2015 06:23 PM |
| Oh wait, the unequipped event isn't firing for you? |
|
|
| Report Abuse |
|
|
powertool
|
  |
| Joined: 01 Feb 2008 |
| Total Posts: 3771 |
|
|
| 21 Jan 2015 06:24 PM |
| Urist, the problem is that reparenting a tool doesn't fire Unequipped. |
|
|
| Report Abuse |
|
|
|
| 21 Jan 2015 06:32 PM |
| Not sure the case where you would have to manually reparent a tool (the default system takes care of that). If you do find that necessary, then perhaps fire the function you have bound to the unequip even when you change the parent. |
|
|
| Report Abuse |
|
|
powertool
|
  |
| Joined: 01 Feb 2008 |
| Total Posts: 3771 |
|
|
| 21 Jan 2015 06:34 PM |
| IthacaMedia might be wording it confusingly, but as I read it he's referring to either :Destroy()ing the tool while it's being held, or reparenting it to something other than the player's inventory. |
|
|
| Report Abuse |
|
|
rennec
|
  |
| Joined: 02 Jul 2014 |
| Total Posts: 28 |
|
|
| 21 Jan 2015 07:00 PM |
um... make the script trigger a value in the tool first, then, when the tool gets that value it'll change the mouse icon. once that's done, make it trigger another value. and when the other value changes, the script will then reparent/remove the tool. |
|
|
| Report Abuse |
|
|
|
| 22 Jan 2015 02:07 PM |
@powertool
Yeah that's what I'm talking about. |
|
|
| Report Abuse |
|
|
|
| 22 Jan 2015 09:00 PM |
| I tried calling the :UnequipTool() method on the Humanoid before removing the tool, but for some reason that's not working. |
|
|
| Report Abuse |
|
|
| |
|
| |
|