How to change a pistol with a machine gun when the player has the pistol in hand.

Started by Twiss on

Topic category: Advanced modding

Last seen on 14:14, 2. Sep 2020
Joined Jun 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to change a pistol with a machine gun when the player has the pistol in hand.

Hello, I would like to create a procedure, a kind of capacity which activates when I press on a "U" and which changes a pistol by a machine gun if the player has the pistol in hand but I can't figured out how to change one item with another and especially when the player has it.

 

Sorry for my English I am French.
 

Last seen on 16:53, 8. Jul 2020
Joined Jun 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
When key [U] pressed Check…
Thu, 07/02/2020 - 10:15

When key [U] pressed

Check if Player has item [pistol] in Hand then do 

delete item from get Slot of item [pistol] in inventory and delete it

then replace the Slot with the new machine gun!