local player = require("player") local world = require("world") local creator = require("creator") local http = require("http") local encoding = require("encoding") local foundLicence = true --- @param entity entity --- @return entity? local function getEntityAbove(entity) if entity then local box = entity.box.expand(1, 2, 1) for index, entity2 in ipairs(world.getEntitiesInBox(box)) do if entity2.display_name:find("MERCHANT") then return entity2 end end end return nil end local function isHasFish() for i = 9, 43, 1 do local stack = player.inventory.getStack(i) if stack then -- 1057 --print("" .. stack.display_name .. " | " .. stack.id) if stack.id == 1057 then return true end end end if player.inventory.isAnyScreenOpened() and player.inventory.getContainerSlots() >= 47 then for i = 54, 88, 1 do local stack = player.inventory.getStack(i) if stack then -- 1057 if stack.id == 1057 then return true end end end end return false end registerClientTick(function() if foundLicence then local ray = player.raycast(4.5) if ray.type == "entity" then local entity = getEntityAbove(ray.data) if entity then if isHasFish() then player.input.interactEntity() end end end if player.inventory.isAnyScreenOpened() and isHasFish() and player.inventory.getContainerSlots() >= 47 then local stack = player.inventory.getStackFromContainer(50) if stack and stack.display_name == "§f[§cSell Settings§f]" and player.inventory.getStackFromContainer(13) == nil then local clicked = false for i = 54, 88, 1 do local stack = player.inventory.getStack(i) or player.inventory.getStackFromContainer(i) if stack then -- 1057 if stack.id == 1057 then player.inventory.shiftLeftClick(i) clicked = true break end end end if clicked then player.inventory.leftClick(49) end end end end end)