Posts: 135
Threads: 37
Joined: Jan 2016
Reputation:
0
As the title says, is this possible?
Posts: 1,275
Threads: 121
Joined: Jul 2011
Reputation:
0
Yes, you can create a function that uses SetPlayerAttachedObject, attach the model ID to the right hand (Bone 6) and save the weapon ID you wanna give as a var, once you wanna give him ammo, just get the var ID and replace the attached object with an actual weapon.
Posts: 519
Threads: 21
Joined: Nov 2012
Reputation:
0
You could attach the weapon object to the player also.
edit; why teh fuck am i so slow.
Posts: 135
Threads: 37
Joined: Jan 2016
Reputation:
0
Thanks Guys, i thinking of it right now, but i have one problem, What if i ran out of ammo? Does the Attached Object will removed also?
Posts: 1,275
Threads: 121
Joined: Jul 2011
Reputation:
0
You don't need an attached object if you were already shooting, you only attach the object if you have 0 ammo, so the 2 scenarios you'd do that is that if you give someone a gun with no ammo, then you'd attach the object, or if you run out of ammo while shooting, you'd attach the object. Other than that, make sure to deattach it while having a gun with ammo.
Posts: 5
Threads: 0
Joined: Jul 2010
Reputation:
0
No. The weapon and the object are considered distinct entities.
Edit: Too slow, I guess. But I just did some quick testing with a Colt 45 weapon and Colt 45 model and while the object's attached, it will seem like the player's holding two guns. When the weapon runs out of ammo, it will disappear but the model will stay. I don't know about bigger weapons or differing weapons; I'd say it's best to follow what -CaRRoT outlined above me.