1.I need help with some scripting that i can't really do, i need to attach my weapon to the character, i have made the weapon and i can rotate it and here is the script:
2.I would also like to make the buttons 1, 2, 3, 4, 5 as weapon buttons, as an example: 1: glock, 2: uzi, 3: mp5, 4: Sniper, 5. bazooka. But i don't want the people to have them all at the beginning, i want them to buy them for kills at the end of the level.
3. How do i make my enemies have more hp or less hp? And how to make the the weapons shoot faster and slower, more dmg and lesser dmg.
I know this is kinda much but this is all the things i don't really understand atm, thanks for reading and if you can help, please do.
Hehe, I ain't a pro, but I could figure this out, but if you want to then go ahead.
Here's my potential solution. Delete code anywhere that has to do with making guns visible or invisible.
In the onLoad function of the mcMain class add: this.glock._visible = true; this.uzi._visible = false; this.sniper._visible = false; //make all other guns invisible and if for some reason that doesn't work change "this." into "_root.mcMain."
before the functions make a var for each gun's availability then in the enterFrame function add:
if(Key.isDown(49) && glockAvailable == true) { _root.mcMain.glock._visible = true; _root.mcMain.sniper._visible = false; _root.mcMain.uzi._visible = false; //make the rest of the guns invisible } if(Key.isDown(50) && sniperAvailable == true) { _root.mcMain.sniper._visible = true; _root.mcMain.glock._visible = false; _root.mcMain.uzi._visible = false; //make other guns invisible } //continue this process for each number for each gun
If you wanted you could also put the movement code here which would be similar to this:
if(Key.isDown(Key.LEFT) or Key.isDown(65)) { _x -= 30; } if(Key.isDown(Key.RIGHT) or Key.isDown(68)) { _x += 30; }
this would work for moving left and right with arrow keys and WASD.
Jumping and gravity: (this may not be the most efficient way to do it, but it should work). Make a var for yspeed. Then in the enterFrame function add: if(Key.isDown(Key.UP) or Key.isDown(87)) { if(yspeed == 0) { yspeed = 30; } } _y -= yspeed; yspeed -= 0.5; // or however much you want it to decrease by per frame
and then do something along the lines of: if(this.hitTest(_root.ground)) { yspeed = 0; _y -- //this is to make your character not sink into the ground. }
hair eyes & body: Do you already have the selection process working?
Oh, well you put it in the enterFrame function of mcMain's class.
One way to do the hair selection thing is to create a variable for the type of hair. Then, when the player presses the button that starts a level, make all types of hair invisible then do something like: if(hairStyle == 1) { _root.mcMain.hair1._visible = true; } if(hairStyle == 2) { _root.mcMain.hair2._visible = true; } // etc. for each hair style.
you can actually open flash and try the scripts out and test if they work while i am sleeping . Isn't that a good idea? When you have solved the problem, then post them here ^^