Skip to content

Conversation

@mccadecortez
Copy link

Hey 👋, I wanted to make a multiplayer perma-death mod & needed a way to kick people so they're not stuck spectating the game when I make the dead character a NPC.

Only issue with kickMsg->GetMessage().mutable_s2c_kick() is that it seems to be a extender message, which is causing clients without extender to crash; Otherwise I'm open to suggestions if there's a better way to implement this, thanks.

	Ex: `Ext.Net.Kick(userID, "kickMessage")`
@mccadecortez
Copy link
Author

Here's some lua code if someone wants to try the death on kick.

Ext.Osiris.RegisterListener("Died", 1, "after", function (character)
    local userID = Ext.Entity.Get(character).UserReservedFor.UserID
    local hostID = Ext.Entity.Get(GetHostCharacter()).UserReservedFor.UserID

    _P(userID, hostID)

    if (userID ~= hostID) then
        MakeNPC(character)
        Ext.Net.Kick(userID, "You died!")
    end
end)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant