-- name: \\#00E000\\Deathlink -- description: Inspired by the Archipelago Randomizer. If one player dies, everyone else dies too. \n\nWritten by Dan\nstring_without_hex() function by birdekek -- Enforce Server Settings gServerSettings.bubbleDeath = 0 gServerSettings.pauseAnywhere = 1 -- Local Values local cooldown = 0 -- On Player Death local function death() -- Enforce Cooldown if cooldown == 0 then -- Send Death Message to Self djui_chat_message_create("\\#80FF80\\" .. string_without_hex(gNetworkPlayers[0].name) .. " has died!") -- Send Kill Packet to Everyone Else, Including the Name for the Message. network_send(true, {name=string_without_hex(gNetworkPlayers[0].name)}) -- Start Cooldown cooldown = 600 end end -- On Packet Receive local function packet_receive(data) -- Set Player Health to 0 gMarioStates[0].health = 255 -- Announce Which Player Died djui_chat_message_create("\\#80FF80\\" .. data.name .. " has died!") -- Start Cooldown (20 Seconds) cooldown = 600 end -- Cooldown Timer local function update() if cooldown > 0 then cooldown = cooldown - 1 end end -- Players Cannot Exit Midair local function on_pause_exit() if gMarioStates[0].action & ACT_FLAG_AIR ~= 0 then return false end return true end -- Remove Color Hex from Name (Code by birdekek) function string_without_hex(name) local s = '' local inSlash = false for i = 1, #name do local c = name:sub(i,i) if c == '\\' then inSlash = not inSlash elseif not inSlash then s = s .. c end end return s end -- Hooks hook_event(HOOK_UPDATE, update) hook_event(HOOK_ON_PACKET_RECEIVE, packet_receive) hook_event(HOOK_ON_DEATH, death) hook_event(HOOK_ON_PAUSE_EXIT, on_pause_exit)