added onPlayerAction

This commit is contained in:
dscarpac 2024-07-03 03:13:18 -05:00
parent b15072642c
commit c15ccf1a18

View File

@ -249,6 +249,15 @@ function onPlayerConnect()
Wait.time(function() playermatApi.redrawSlotSymbols("All") end, 0.2)
end
function onPlayerAction(player, action, targets)
if action == Player.Action.Delete and player.admin == false then
for _, target in ipairs(targets) do
local matColor = playermatApi.getMatColorByPosition(target.getPosition())
local trash = guidReferenceApi.getObjectByOwnerAndType(matColor, "Trash")
trash.putObject(target)
end
end
end
---------------------------------------------------------
-- chaos token drawing
---------------------------------------------------------