How to make a permanant death event game like AOT Expanse or AoT Project

Need help on how to make a PD system. Firstly -

How do I script a pd event? Where a whitelisted player has access to view and open an admin panel, in this admin panel there are two buttons. To enable PD and disable PD. When he presses enable PD, the entire server has PD enabled and if you die in the game you get kicked and lose progress and when he disables it turns off and you can die and not lose progress. Also a notification message to notify pd enabled.

local admins = "" -- Admin name
local syntax = "!"
local adminBoard = "" -- Name of admin GUI

function AdminPowers(plr)
	if plr.Name == admins then
	plr.Chatted:connect(function(msg)
		if msg == syntax .. "Admin Panel open" then -- message should be your syntax, then no space, Admin Panel open.
			game.Players[plr.Name].PlayerGui[adminBoard].Enabled = true
		elseif msg == syntax .. "Admin Panel close" then --Opposite, closes it.
			game.Players[plr.Name].PlayerGui[adminBoard].Enabled = false
		end
		end)
	end
end

game:GetService("Players").PlayerAdded:Connect(AdminPowers)

This opens the admin board. Then you can put this script inside the button to enable it.

game.Players.RespawnTime = 5

function Permadeath()
	game.Players.RespawnTime = 5000000000000000000000 -- No respawn.
        local Message = Instance.new("Message")
        Message.Text = "Permadeath is enabled!"
        Message.Name = "PermadeathNotification"
        Message.Parent = game.Workspace
        wait(10)
        game.Workspace.PermadeathNotification:Remove()
end

script.Parent.MouseButton1Down:Connect(Permadeath)

And this script in the button to DISable it.


game.Players.RespawnTime = 5

function Permadeath()
	game.Players.RespawnTime = 5
end

script.Parent.MouseButton1Down:Connect(Permadeath)

Do note, for this to work you’ll have to make the GUi hidden by default.
Anyways hoped i helped :slight_smile:

If you wanna add other stuff to the panel you can add to it! Its easy because all the command system does is enable the GUi, meaning you dont need to worry about anything breaking.

1 Like