Hello coders,
I was wondering if some of you including john my coding teacher would help me master the scripting of weapons and melees. Hope you guys could help. :)
Printable View
Hello coders,
I was wondering if some of you including john my coding teacher would help me master the scripting of weapons and melees. Hope you guys could help. :)
Just make a weapon that makes you change ganis, and add some damage script to it. As basic as that.
Yes I know but how do I script it?
You have many way to do it, for example without an Inventory Script, you could just do something like:
-Player who has weapon say /equip weapon
-Then you replace replace basics gani with replaceani("idle","yourweapon-idle")
-And if you say /remove gun you could replace again the gani
Giving you a small script for it:
PHP Code:
#//CLIENTSIDE
function onPlayerChats(){
if(player.chat == "/equip yourweaponname"){
replaceani("idle", "yourweaponname-idle");
replaceani("walk", "yourweaponname-walk");
replaceani("sword", "yourweaponname-sword");
}
if(player.chat == "/remove yourweaponname"){
replaceani("idle", "idle");
replaceani("walk", "walk");
replaceani("sword", "sword");
}
}
Is that how normal weapons on era are scripted?
Yes, but it's way more complicated since it has a damage system.
Yea, when I put the script, I told you that it was a simple script to show you a starting way, you can improve it with damage system, you can add a freeze time,... and if you make a gun it'll include much more parameters.
I love to see this section to blow my mind
thank you for help