Release Attach Model to Specific Bone [Clean]

SlothWiiPlaza

Known Member
Messages
34
Points
118
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.



 

Tusta

Head Member
Donator
Messages
18
Points
164
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