Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Who can help with my Inventory?

who can help me with this? (comments what i tried, and the stuff i need and what it does is at the bottom besides ///@@@




local Player = game.Players.LocalPlayer.Backpack
local VBin = Player
local Inventory = VBin:WaitForChild("Equipment")

local Div = 5   --- if i change this to 1, only one box shows up and cant delete it
local Cells = {}
local Connections = {}

function DropConnections()
	for i=1,#Connections do
		Connections[i]:disconnect()
	end
	Connections = {}
end


function GenerateCell(X,Y)
	local Cell = Instance.new("TextButton")
	Cell.BackgroundColor3 = Color3.new(0,0,0)
	Cell.BorderColor3 = Color3.new(1,1,1)
	Cell.TextColor3 = Color3.new(1,1,1)
	Cell.BackgroundTransparency = 0.4
	Cell.Name = "Cell"
	Cell.Font = "ArialBold"
	Cell.FontSize = "Size12"
	Cell.Text = ""
	Cell.Visible = false
	Cell.Active = true
	
	Cell.Position = UDim2.new((X-0)*(0/Div),1,(Y-2)*(0.5/Div),2)
	
	Cell.Size = UDim2.new(1/Div,1,0.2/Div,1)
	
	
	local Link = Instance.new("ObjectValue")
	Link.Name = "Link"
	Link.Parent = Cell
	
	Cell.Parent = script.Parent
	Cells[#Cells+1] = Cell
end

///@@@ it makes 4 boxes at the position: {0, 1},{-0.2, 2}

and 4 boxes at this position: {0, 1},{0, 2}

(only giving postions of the ones that have weapons in them

what i want is for each weapon to have it own box. there's 4 overlapped right now.

??

2 comments

0

thats the X position (it would move it to the left or right)

0

Cell.Position = UDim2.new((X-0)*(1/Div),1 ---- makes the button go like |Sword| |Sword| |Sword| |Sword| (side by side) i want it up to down

1 answer

Your X multiplier is 0

(X-0)*(0/Div)

Are you sure what's what you meant? That will set the X to 0 at all times regardless of what was input.

2 comments

0

i want it to go down Y-axis. not across X-axis, so yes.

0

Then you don't need the misleading extra stuff

This discussion is preserved as it was. New answers, comments, and votes are closed.