Trying to set the parent to nil on an attempt to gravgun
3 replies, posted
I'm working on a script that attaches things to cars, and I want to have them come off when you gravgun them. The problem I'm facing is that GM:GravGunOnPickedUp is only triggered when you actually pick up and are holding the object (which is impossible if they're a child to the car), but I want to make it so when they [I]attempt[/I] to pick it up by right clicking it gets detached. GM:GravGunPickupAllowed is called when the player is looking at and in range of the entity, and gets spammed, so that's no good. Which hook should I be using for this?
Still trying to figure this out.
why not just use GM:GravGunPickupAllowed and check their inputs to see if they are holding right click?
[QUOTE=legendofrobbo;51277190]why not just use GM:GravGunPickupAllowed and check their inputs to see if they are holding right click?[/QUOTE]
It simply is called too fast for any meaningful code to be run - a simple if statement checking if the parent entity is a vehicle fails.
Sorry, you need to Log In to post a reply to this thread.