콘텐츠로 건너뛰기
작동 중

Dungeon Quest! INVENTORY SORTER SCRIPT - VERY USEFUL

CLclarkdevlinorg0 조회수Universal2026년 7월 26일
공유
Dungeon Quest! INVENTORY SORTER SCRIPT - VERY USEFUL

스크립트 코드

Lua
local SortByRarity = true -- common, uncommon, rare, epic, legendary
local SortBackwards = true

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local SellEvent = ReplicatedStorage:WaitForChild("remotes"):WaitForChild("sellItemEvent")
local PlayerGui = game:GetService("Players").LocalPlayer:WaitForChild("PlayerGui")
local Inventory = PlayerGui:WaitForChild("inventory"):WaitForChild("mainBackground"):WaitForChild("innerBackground"):WaitForChild("rightSideFrame"):WaitForChild("ScrollingFrame")

local function RefreshInventory()
	SellEvent:FireServer({["ability"] = {},["helmet"] = {},["chest"] = {},["weapon"] = {}})
end

local function GetInventorySize(Table)
	local Count = 0
	for i,v in pairs(Table) do
		for ii,v in pairs(v) do
			Count += i == "keys" and 0 or 1
		end
	end
	return Count
end

local RarityLayout = {["common"] = 1, ["uncommon"] = 2, ["rare"] = 3, ["epic"] = 4, ["legendary"] = 5}

local function SortInventory(Table)
	local function SortLocation(Location)
		for _,Label in pairs(Location:GetChildren()) do
			if Label:IsA("ImageLabel") then
				local itemType = Label:WaitForChild("itemType").Value
				local uniqueItemNum = Label:WaitForChild("itemType"):WaitForChild("uniqueItemNum").Value
				for i,v in pairs(itemType == "weapon" and Table.weapons or itemType == "helmet" and Table.helmets or itemType == "ability" and Table.abilities or itemType == "chest" and Table.chests) do
					if tonumber(string.sub(i,itemType == "weapon" and 8 or itemType == "helmet" and 8 or itemType == "ability" and 9 or itemType == "chest" and 7)) == uniqueItemNum then
						Label.LayoutOrder = SortByRarity and SortBackwards and 6-RarityLayout[v.rarity] or SortByRarity and RarityLayout[v.rarity] or SortBackwards and 999-tonumber(v.levelReq) or tonumber(v.levelReq)
					end
				end
			end
		end
	end

	SortLocation(Inventory)
	if PlayerGui:FindFirstChild("tradingGui") then SortLocation(PlayerGui:WaitForChild("tradingGui"):WaitForChild("mainBackground"):WaitForChild("innerBackground"):WaitForChild("rightSideFrame"):WaitForChild("ScrollingFrame")) end
	if PlayerGui:FindFirstChild("blacksmith") then SortLocation(PlayerGui:WaitForChild("blacksmith"):WaitForChild("Frame"):WaitForChild("innerFrame"):WaitForChild("rightSideFrame"):WaitForChild("ScrollingFrame")) end
	if PlayerGui:FindFirstChild("sellShop") then SortLocation(PlayerGui:WaitForChild("sellShop"):WaitForChild("Frame"):WaitForChild("innerFrame"):WaitForChild("rightSideFrame"):WaitForChild("ScrollingFrame")) end
end

ReplicatedStorage.remotes.updateLocalInventoryTable.OnClientEvent:Connect(function(UpdatedTable)
	if UpdatedTable then
		--itemtable = updatedtable;
		--print(GetInventorySize(UpdatedTable))
		SortInventory(UpdatedTable)
	end;
end); RefreshInventory()

PlayerGui.ChildAdded:Connect(function(v)
	if v.Name == "tradingGui" or v.Name == "blacksmith" or v.Name == "sellShop" then
		local ScrollFrame = v.Name == "sellShop" and PlayerGui:WaitForChild("sellShop"):WaitForChild("Frame"):WaitForChild("innerFrame"):WaitForChild("rightSideFrame"):WaitForChild("ScrollingFrame") or 
			v.Name == "blacksmith" and PlayerGui:WaitForChild("blacksmith"):WaitForChild("Frame"):WaitForChild("innerFrame"):WaitForChild("rightSideFrame"):WaitForChild("ScrollingFrame") or 
			v.Name == "tradingGui" and PlayerGui:WaitForChild("tradingGui"):WaitForChild("mainBackground"):WaitForChild("innerBackground"):WaitForChild("rightSideFrame"):WaitForChild("ScrollingFrame")
		ScrollFrame.ChildAdded:Wait()
		RefreshInventory()
	end
end)

설명

Original description was lost during migration. Sorry for any inconvenience caused. - robloxscripts.com Admin

댓글 (0)

대화에 참여하려면 로그인하세요

  • 첫 댓글을 작성하세요.

자주 묻는 질문

Dungeon Quest! INVENTORY SORTER SCRIPT - VERY USEFUL 스크립트는 어떻게 사용하나요?
위의 스크립트 코드를 복사하고, Roblox 엑시큐터를 열어 붙여넣은 후, 게임 중에 실행을 누르세요. 스크립트가 실행되면 기능이 즉시 활성화됩니다.
Dungeon Quest! INVENTORY SORTER SCRIPT - VERY USEFUL 스크립트는 무료인가요?
네. 이 스크립트는 무료로 복사하고 사용할 수 있습니다. 키 시스템을 사용하는 경우, 링크를 통해 무료로 키를 받으세요.
Dungeon Quest! INVENTORY SORTER SCRIPT - VERY USEFUL 스크립트는 안전한가요?
전체 소스 코드가 이 페이지에 표시되어 실행 전에 정확히 무엇을 하는지 확인할 수 있습니다. 항상 신뢰할 수 있는 엑시큐터를 사용하고, 스크립트 사용은 Roblox 이용 약관에 위반되므로 자의적 위험으로 사용하세요.
Dungeon Quest! INVENTORY SORTER SCRIPT - VERY USEFUL에 호환되는 엑시큐터는?
이 스크립트는 대부분의 인기 Roblox 엑시큐터에서 작동합니다. 기기에 맞는 신뢰할 수 있는 무료 또는 유료 엑시큐터를 찾으려면 엑시큐터 페이지를 확인하세요.
Dungeon Quest! INVENTORY SORTER SCRIPT - VERY USEFUL | BloxScripter