So I was trying to get this permadeath system to work but when I said ":PD ON" it kept giving me an error in game
--:PD ON Is not a valid EnumItem Stack Begin Script Players.enacent00.PlayerGui.PDUI.Toggle , Line 9 Stack End
This is the code in the script
local GroupID = 4327198 local MinRank = 230 local Player = game.Players.LocalPlayer local UIS = game:GetService("UserInputService") local Bind = ":PD ON" UIS.InputBegan:Connect(function(K,T) if K.KeyCode == Enum.KeyCode[Bind] and not T then if Player:GetRankInGroup(GroupID) >= MinRank or Player.Name == "YnwRash" or Player.Name == "enacent00"then if script.Parent.Enabled == true then script.Parent.Enabled = false elseif script.Parent.Enabled == false then script.Parent.Enabled = true end end end end)
Try the following:
local GroupID = 4327198 local MinRank = 230 local Player = game.Players.LocalPlayer local UIS = game:GetService("UserInputService") local Bind = ":PD ON" local Admins = {YnwRash = true, enacent00 = true} -- Define admins Player.Chatted:Connect(function(Message) if Message == Bind then -- If the message is the same if Player:GetRankInGroup(GroupID) >= MinRank or Admins[Player.Name] then -- Detect if player is an admin or is in group script.Parent.Enabled = not script.Parent.Enabled -- Disable/Enable the gui end end end)