Hello, I have tested my code but nothing is happening... Why ? PHP: public function onTransaction(InventoryTransactionEvent $e) { $transactions = $e->getTransaction()->getInventories(); $player = null; $chestinv = null; $action = null; $item = null; foreach ($transactions as $transaction) { $inv = $transaction->getHolder()->getInventory(); if ($inv instanceof ChestInventory) { foreach ($inv->getViewers() as $assumed) { if ($assumed instanceof Player) { $player = $assumed; $chestinv = $inv; $action = $transaction; break 2; } } } foreach ($e->getTransaction()->getActions() as $inventoryAction) { $item = $inventoryAction->getSourceItem(); } if (is_null($player ?? $chestinv ?? $action)) { return; } if ($action instanceof SlotChangeAction) { $slot = $action->getSlot(); $this->Shopbuy($player, $item, $chestinv, $slot); } } }
Noo.. please stop your thread I have modify the code for clean up I just forget a semicolon problem is not that you dont help me I dont have error.