Release Attach Model to Specific Bone [Clean]

SlothWiiPlaza

Veteran
Messages
34
Reaction score
28
Points
793
Hello CabConModding, :tonguewink:
I've had the idea to make a "Soldier" Customizer for my menu.
I was looking through some GSC Scripts and noticed the Attach Model functions is very messy.

I've made it look clean and much better. :wink:

Let's take a look:
Paste this in anywhere in your GSC:
PHP:
attachFunc(model, bone)
{
    self endon("resetBones");
    self endon("death");
    
    self attach(model, bone); //Model to attach to bone
    self setclientthirdperson(1); //Third Person
    self iprintlnbold(self.name + ": Attached ^5" + model + "^7 to ^5" + bone + "^7."); //println to say which model you attached to which bone
}

To call the function in, we simply make a new option in our menu like so:
PHP:
add_option(yoursubmenuhere, "Option 1", ::attachFunc); //Change to your add_option function!
Now, let's start attaching stuff, we want to attach a Care Package to our Jaw, change the function to this:
PHP:
add_option(yoursubmenuhere, "Care Package", ::attachFunc, "t6_wpn_supply_drop_ally", "j_jaw");

As you can see we added our model name and Bone name into the function calling to fill in the functions "model" and "bone" strings, make sure to replace them with different models/bones
for more customization. :smirk:

Again, this isn't anything new, i've wanted to share it with you guys so you don't need 20+ c+p'd functions when it can be done easier.

If you have any questions or need help, feel free to ask me. :relaxed:

Credits:
VerTiCal for the Bones list and Model List posted here.



 

VerTical

CEO
Donator
Messages
0
Reaction score
-82
Points
664
Hello CabConModding, :tonguewink:
I've had the idea to make a "Soldier" Customizer for my menu.
I was looking through some GSC Scripts and noticed the Attach Model functions is very messy.

I've made it look clean and much better. :wink:

Let's take a look:
Paste this in anywhere in your GSC:
PHP:
attachFunc(model, bone)
{
    self endon("resetBones");
    self endon("death");
   
    self attach(model, bone); //Model to attach to bone
    self setclientthirdperson(1); //Third Person
    self iprintlnbold(self.name + ": Attached ^5" + model + "^7 to ^5" + bone + "^7."); //println to say which model you attached to which bone
}

To call the function in, we simply make a new option in our menu like so:
PHP:
add_option(yoursubmenuhere, "Option 1", ::attachFunc); //Change to your add_option function!
Now, let's start attaching stuff, we want to attach a Care Package to our Jaw, change the function to this:
PHP:
add_option(yoursubmenuhere, "Care Package", ::attachFunc, "t6_wpn_supply_drop_ally", "j_jaw");

As you can see we added our model name and Bone name into the function calling to fill in the functions "model" and "bone" strings, make sure to replace them with different models/bones
for more customization. :smirk:

Again, this isn't anything new, i've wanted to share it with you guys so you don't need 20+ c+p'd functions when it can be done easier.

If you have any questions or need help, feel free to ask me. :relaxed:

Credits:
VerTiCal for the Bones list and Model List posted here.



Cool :smile:
 
Top