orkel1215 Posted September 16, 2020 Share Posted September 16, 2020 How do I prevent the player from dropping an item ? I still want the player to be able to store the item in a container and have the item have weight. I have been unable to find a solution to this. Any help would be greatly appreciated. Link to comment Share on other sites More sharing options...
UnvalidUserName Posted September 16, 2020 Share Posted September 16, 2020 Attach a script to the item with an OnDrop block. Make the block Disable and MarkForDelete the item when dropped and add back another copy of it to the player's inventory. Link to comment Share on other sites More sharing options...
orkel1215 Posted September 16, 2020 Author Share Posted September 16, 2020 (edited) Attach a script to the item with an OnDrop block. Make the block Disable and MarkForDelete the item when dropped and add back another copy of it to the player's inventory.How do you add back the object? Player.additem <ObjectID>, How do I get the ref? Getself always returns 0 Edited September 16, 2020 by orkel1215 Link to comment Share on other sites More sharing options...
UnvalidUserName Posted September 16, 2020 Share Posted September 16, 2020 Try using "this" keyword as reference then. And yes use, Player.AddItem object ID 1 1. The last 1 means it will hide the item added message Link to comment Share on other sites More sharing options...
orkel1215 Posted September 16, 2020 Author Share Posted September 16, 2020 Try using "this" keyword as reference then. And yes use, Player.AddItem object ID 1 1. The last 1 means it will hide the item added messageSo I found that using implied references works. let rSelf := GBO let fCondition := GetCurrentHealth player.addItemAlt rSelf 1 fCondition 0 "This" Also didn't work it actually through an error for that. Link to comment Share on other sites More sharing options...
UnvalidUserName Posted September 16, 2020 Share Posted September 16, 2020 Yeah "this" never worked for me either but it's mentioned everywhere in the wikis so I assumed it was just my problem. If the object has no world model it will "disappear" when dropped but you should still find some way to MarkForDelete on it just to make sure it doesn't stick in the save file. Link to comment Share on other sites More sharing options...
orkel1215 Posted September 16, 2020 Author Share Posted September 16, 2020 Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts