Files

33 lines
845 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.
# DeicideLookS.js — main() (satır 14)
[← DeicideLookS.js](index.md) · [← Master](../../wiki.md)
```javascript
function main(c)
{
var target = c.getSubject();
var source = c.getServer().getPlayer("Xyrveth");
var sourcePos = source.getPosition();
var targetPos = target.getPosition();
var sourceEyes = {
x: sourcePos.x,
y: sourcePos.y + source.getEyeHeight(),
z: sourcePos.z
};
var targetEyes = {
x: targetPos.x,
y: targetPos.y + target.getEyeHeight(),
z: targetPos.z
};
var look = calculateLookRotation(targetEyes, sourceEyes);
target.setRotations(look.pitch, look.yaw, look.yaw);
target.lockRotation(look.yaw, look.pitch, look.yaw);
target.lockPosition(targetPos.x, targetPos.y, targetPos.z);
}
```