player:set_wield_item() not working in craftitem:on_use()
-
- Member
- Posts: 159
- Joined: Mon Feb 18, 2019 02:53
- GitHub: LandonAConway
player:set_wield_item() not working in craftitem:on_use()
I have a craftitem and it uses the on_use function. However, if i use player:set_wield_item() inside the function, nothing is changed. What the heck? It is 100% required for me to be able to do this. Not exceptions no alternatives accepted. I MUST do this.
cdb_ac3a146dcafb
Re: player:set_wield_item() not working in craftitem:on_use()
Please write what you are tying to do with this item and it's on_use and we can maybe find a solution.
- Skamiz Kazzarch
- Member
- Posts: 618
- Joined: Fri Mar 09, 2018 20:34
- GitHub: Skamiz
- In-game: Skamiz
- Location: la lojbaugag.
-
- Member
- Posts: 159
- Joined: Mon Feb 18, 2019 02:53
- GitHub: LandonAConway
Re: player:set_wield_item() not working in craftitem:on_use()
Literally all I did was used "set_wield_item" funtion in "on_use". No other code was there. As for the item I'm setting it to, its just modifying the meta of the item stack.
cdb_ac3a146dcafb
- Krock
- Developer
- Posts: 4650
- Joined: Thu Oct 03, 2013 07:48
- GitHub: SmallJoker
- Location: Switzerland
- Contact:
Re: player:set_wield_item() not working in craftitem:on_use()
The return value of "on_use" overwrites the selected item after you called the function.
Modify the itemstack and return that to set the wielded item.
Modify the itemstack and return that to set the wielded item.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
Who is online
Users browsing this forum: No registered users and 9 guests