ForumsProgramming Forum[Need Help] Attaching movie clips (my weapons).. etc

115 37127
Voidcrystal
offline
Voidcrystal
138 posts
Nomad

Hello!

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:

onClipEvent (enterFrame) {

_rotation = ((Math.atan2(_root._ymouse-_y,_root._xmouse-_x)/(Math.PI/180))+90)
}

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.

  • 115 Replies
Voidcrystal
offline
Voidcrystal
138 posts
Nomad

Thanks alot abn for all your help i found another way myself.

Holden012
offline
Holden012
1,989 posts
Nomad

wow Scripting looks hard :S Confusing even!

Dannydaninja
offline
Dannydaninja
948 posts
Nomad

Oh man... with the stuff i do, i use small basic code... nothing like that crazy stuff

Holden012
offline
Holden012
1,989 posts
Nomad

lol i see why!

Voidcrystal
offline
Voidcrystal
138 posts
Nomad

it is not crazy :P

Voidcrystal
offline
Voidcrystal
138 posts
Nomad

how to disable the "rotating script", and when (shift) is clicked it will make "rotating script" able?

AbnormalIdiot
offline
AbnormalIdiot
110 posts
Nomad

couldn't you do something like making a variable for the rotating script and if shift is pressed change the value of the variable

Voidcrystal
offline
Voidcrystal
138 posts
Nomad

yeah but the problem is that i have tried to make the script a var trying to make the script (= false.

BTW what do you mean with value of the variable?

AbnormalIdiot
offline
AbnormalIdiot
110 posts
Nomad

Ok, make 2 variables: shiftPressed and rotatable
in the onLoad make shiftPressed false, and rotatable true if you want it to default as being able to use the rotating script, or false if not. Then do something like this:

if(Key.isDown(Key.SHIFT) && shiftPressed == false)
{
shiftPressed = true;
if(rotatable == false)
{
rotatable = true;
}
else if(rotatable == true)
{
rotatable = false;
}
}
if(!Key.isDown(Key.SHIFT))
{
shiftPressed = false;
}

Voidcrystal
offline
Voidcrystal
138 posts
Nomad

nice it worked

Showing 106-115 of 115