Quantcast
Channel: Questions in topic: "javascipt"
Viewing all articles
Browse latest Browse all 1875

Healthbar in js

$
0
0
hello everyone i have PlayerStats.js i tried to find add healthbar but i found always .cs type can someone help me how can i add healthbar it basicly i know creating canvas and healthbar, background images this is my script #pragma strict var MaxHealth = 100; var Health : int; function Start () { Health = MaxHealth; } function ApplyDamage (TheDamage : int) { if(Health >= 0) { Health -= TheDamage; } if(Health <= 0) { Dead(); } } function Dead() { RespawnMenuV2.playerIsDead = true; Debug.Log("Player Died"); } function RespawnStats () { Health = MaxHealth; }

Viewing all articles
Browse latest Browse all 1875

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>