A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Give me a script

  1. #1

    Post

    I need this script that make a character die exactly when the health reaches 0 or anything lower then 0. The health is supposed to be a dynamic textbox. When it reaches zero the character dies. Does anyone have this script?

  2. #2

    no one can help me

    So out of the thousands of people in this forum there is no one that can help me with my problem not even the MadSci or Oolorin or someone like an administrator.

  3. #3
    Senior Member
    Join Date
    Jun 2000
    Posts
    435
    Hi, havocking

    Are you familiar with “if” statements?

    Well it would look something like this:

    Code:
     
    onClipEvent (enterFrame) {
        if (health <= 0) {
            this.state = “died”;
            this.gotoAndPlay("kick_the_bucket");
        }
    }
    I hope this helps, you can read up on "if" statements in your ActionScript Reference Guide on pages #17, #60

    Happy Flashing

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center