Files

32 lines
951 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# npc.js — startLoop() (satır 374)
[← npc.js](index.md) · [← Master](../../wiki.md)
Parça 3/3 · [önceki](startLoop-2.md)
```javascript
// hasar anında, hasar alan oyuncunun yanında diyalog aç (cooldown'lı)
var now = Date.now();
if (now > (mappet.get("hector_dialogue_cd") || 0))
{
target.executeCommand("/mp dialogue open @p[r=5] " + DIALOGUE_ID);
mappet.set("hector_dialogue_cd", now + DIALOGUE_CD_MS);
}
continue;
}
if (dist < STOP_DIST) continue;
// hedefe doğru it + yüzünü çevir
e.addMotion((dx / dist) * FOLLOW_SPEED, 0, (dz / dist) * FOLLOW_SPEED);
e.setRotations(0, yaw, yaw);
}
ctx.scheduleScript(LOOP_TICKS, loop);
}
c.scheduleScript(LOOP_TICKS, loop);
}
```