Best way to equip/unequip weapon automatically via script

AntL

Member
Hey there, when my player comes within a certain distance of a character, I want to automatically equip him with a pistol. He shouldn't be able to manually equip this at any point.

Equally, if the player and the character are beyond a certain distance, I want the player to automatically unequip his pistol. So there's no manual equiping, it's all controlled through script.

Could you point me in the right direction of how to achieve this? Should I have the pistol added to his inventory by default then unequip/equip it? If so are there any easy to follow examples of this in existing abilities?

Cheers
 
Top