PDA

View Full Version : Weapon Scripting HELP


Poogle
06-16-2001, 04:54 AM
Whats the script where you use like lets say a customed bow it will take 1 dart how do you make it work?

Bane2000
06-16-2001, 05:20 AM
i'm not sure how much code u need, but if you want to make the arrowcount go down when fired it';s :

if (weaponfired) {
playerdarts=playerdarts-=1;
}

or somthing, i can do it i just cant remember the words of it' dart or darts etc...

but if you tell me exactly what u want i can tell you.

if (weaponfired) {
freezeplayer 1;
playerdarts=playerdarts-=1;
setani shoot,;
etc..... (your special coding for arrow here)
}

i dunno, i only just started screipting so i hope it helps

Munkey
06-16-2001, 05:38 AM
auctually you could use playerdarts-=1; it's shorter.

Bane2000
06-16-2001, 05:53 AM
of coure, sorry i'm a thick twat sdome times just use to usually scripting that way.

just working on a large script at the moment and it's got my mind all over the place

Poogle
06-16-2001, 06:06 AM
if playerdarts-=1; is it I am tring to make a bomy bomb and a bomy bow lol ive got this much done:
if (bomyweaponfired) {
setani bomy_shot,;
freezeplayer 1;
shotarrow playerdir;
(tring)playerdarts-=1;
}

Poogle
06-16-2001, 06:11 AM
Im sorry but i need one more thing How to make a weapon not fired if they have no darts

Munkey
06-16-2001, 07:46 AM
ok well that should be this,

if (bomyweaponfired&&playerdarts>=1) {
setani bomy_shot,;
freezeplayer 1;
playerdarts-=1;
shotarrow playerdir;
}

// i think the normal bow freezes a player for .5 seconds but i'm not sure.

TB3
06-16-2001, 08:03 AM
Due to the fact that the bomy uses freezeplayer in its script im pretty sure there is another script that calls it to freeze its gani and movement but you will have to ask stefan but this below would work if you were a bomy and had the freeze flag or variable set.

if (playertouchsme&&!isweapon&&!hasweapon(Bomy Bow)&&strequals(client.race,bomy)) {tobomyweapons Bomy Bow;}

if (bomyweaponfired&&playerdarts>0) {
playerdarts-=1;
setani bomy_shot,bownameifitsinparams;
freezeplayer2;//You will need to find out the bomy freeze variable for this part
shotarrow playerdir; //Umm you can use this but i make my own arrays for stuff like this ... more custom.
}