
* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.
* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.
zep으로 간단한 pvp를 만들려고 하는데
들어가면 player.title이 나타나지만
공격시 수치가 줄어들지 않아요
도와주세요
let player_health = 100;
let _player = App.players;
App.onUnitAttacked.Add(function(sender, x, y, target){
player_health = player_health - 10;
target.sendUpdated();
})
App.onUpdate.Add(function(dt){
for(let i in _player){
let p = _player[i];
p.title = player_health;
p.sendUpdated();
}
})
App.onJoinPlayer.Add(function(player){
player.title = player_health;
player.sendUpdated();
})
