Skip to content

Commit

Permalink
Fix permakill plugin (NebulousCloud#275)
Browse files Browse the repository at this point in the history
  • Loading branch information
WolfunGarden authored Feb 17, 2021
1 parent f308dc7 commit 46d6a27
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions plugins/permakill.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ ix.config.Add("permakillWorld", false, "Whether or not world and self damage pro
function PLUGIN:PlayerDeath(client, inflictor, attacker)
local character = client:GetCharacter()

if (ix.config.Get("permakill")) then
if !(ix.config.Get("permakillWorld") and (client == attacker or inflictor:IsWorld())) then
if (ix.config.Get("permakill") and character) then
if (ix.config.Get("permakillWorld") and !(client == attacker or inflictor:IsWorld())) then
return
end

character:SetData("permakilled", true)
end
end
Expand All @@ -25,5 +26,6 @@ function PLUGIN:PlayerSpawn(client)
local character = client:GetCharacter()
if (ix.config.Get("permakill") and character and character:GetData("permakilled")) then
character:Ban()
character:SetData("permakilled")
end
end

0 comments on commit 46d6a27

Please sign in to comment.