Self damage


Recommended Posts

An example of self damage I made for moon:
 

function damagePlayer() {

    var offset = 0.0625;

    for (var i = 0; i < 49; ++i) {

        player.sendPacket(0x04,

            player.getX(), player.getY() + offset, player.getZ(),

            false)

        player.sendPacket(0x04,

            player.getX(), player.getY(), player.getZ(),

            false)

    }

    player.sendPacket(0x03, true);

}
 

Share this post


Link to post
Share on other sites

  • 3 weeks later...

accumulate over 3.0125 blocks of fall distance without sending a true ground state packet in between. 

module_manager.register('selfdamage', {
    on_pre_motion = function(t)
        local start = 0
        while start < 3.0125 do
            start = start + math.min(0.42, 3.0125 - start)
            player.send_packet_no_event(0x04, t.x, t.y + start, t.z, false)
        end
        player.send_packet_no_event(0x04, t.x, t.y, t.z, false)
        player.send_packet_no_event(0x03, true)
        player.message('.selfdamage')
        return t
    end
})

 

Share this post


Link to post
Share on other sites

@Idlecan you try and convert this?
 

function damagePlayer() {
    var offset = 0.0625;
    for (var i = 0; i < 49; ++i) {
        player.sendPacket(0x04,
            player.getX(), player.getY() + offset, player.getZ(),
            false)
        player.sendPacket(0x04,
            player.getX(), player.getY(), player.getZ(),
            false)
    }
    player.sendPacket(0x03, true);
}

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share