handle nil

This commit is contained in:
Chr1Z93 2024-07-04 23:09:56 +02:00
parent bd17c40abc
commit 35935c0fdc

View File

@ -254,7 +254,7 @@ function onPlayerConnect()
end
function onPlayerAction(player, action, targets)
if action == Player.Action.Delete and player.admin == false then
if action == Player.Action.Delete and not player.admin then
for _, target in ipairs(targets) do
local matColor = playermatApi.getMatColorByPosition(target.getPosition())
local trash = guidReferenceApi.getObjectByOwnerAndType(matColor, "Trash")