51 lines
1.4 KiB
Markdown
51 lines
1.4 KiB
Markdown
# Hipnoz.js — main() (satır 14)
|
||
|
||
[← Hipnoz.js](index.md) · [← Master](../../wiki.md)
|
||
|
||
```javascript
|
||
function main(c)
|
||
{
|
||
var source = c.getSubject();
|
||
|
||
// Scripti çalıştıran oyuncu
|
||
var target = source;
|
||
|
||
var targetPos = target.getPosition();
|
||
|
||
// Oyuncunun tam önüne spawn
|
||
var yawRad = (target.getYaw() + 90) * Math.PI / 180;
|
||
|
||
var hx = targetPos.x + Math.cos(yawRad);
|
||
var hz = targetPos.z + Math.sin(yawRad);
|
||
var hy = targetPos.y;
|
||
|
||
var look = calculateLookRotation(
|
||
{x: hx, y: hy + 1.6, z: hz},
|
||
{x: targetPos.x, y: targetPos.y + 1.6, z: targetPos.z}
|
||
);
|
||
|
||
var skin = "https://mutluresim.com/images/2026/05/26/Xc5LFG.png";
|
||
var morfNBT = '{Skin:"' + skin + '",Name:"blockbuster.alex",ForcedSettings:0b}';
|
||
|
||
c.executeCommand(
|
||
"mp morph add world 10 " +
|
||
hx + " " + hy + " " + hz + " " +
|
||
look.yaw + " " + look.pitch + " " +
|
||
morfNBT
|
||
);
|
||
|
||
var targetLook = calculateLookRotation(
|
||
{x: targetPos.x, y: targetPos.y + 1.6, z: targetPos.z},
|
||
{x: hx, y: hy + 1.6, z: hz}
|
||
);
|
||
|
||
target.setRotations(targetLook.pitch, targetLook.yaw, targetLook.yaw);
|
||
target.lockRotation(targetLook.yaw, targetLook.pitch, targetLook.yaw);
|
||
|
||
c.scheduleScript(10, function(c)
|
||
{
|
||
target.unlockRotation();
|
||
});
|
||
}
|
||
```
|