I have a inventory gui that I am making so you can move to "Sort" your inventory. It will not work, It always errors. Here is the script (Normal script inside text button):

local MovingInventory = script.Parent.Parent.Parent.Parent.Parent.MovingInventory
local SlotMoving = script.Parent.Parent.Parent.Parent.Parent.MovingInventory

script.Parent.MouseButton1Click:Connect(function()
	if MovingInventory.Value == false then
		MovingInventory.Value = true
		SlotMoving.Value = script.Parent.Name
	elseif MovingInventory.Value == true then
		MovingInventory.Value = false
		game.ReplicatedStorage.Values:WaitForChild("Item").Value = script.Parent.Parent:FindFirstChild(SlotMoving.Value).Item.Value
		game.ReplicatedStorage.Values:WaitForChild("Amount").Value = script.Parent.Parent:FindFirstChild(SlotMoving.Value).Amount.Value
		script.Parent.Item.Value = script.Parent.Parent:FindFirstChild(SlotMoving.Value).Item.Value
		script.Parent.Amount.Value = script.Parent.Parent:FindFirstChild(SlotMoving.Value).Amount.Value
		script.Parent.Parent:FindFirstChild(SlotMoving.Value).Item.Value = game.ReplicatedStorage.Values.Item.Value
		script.Parent.Parent:FindFirstChild(SlotMoving.Value).Amount.Value = game.ReplicatedStorage.Values.Amount.Value
	end
end)

Thoughts, thanks!

5 comments

0

What line does this error occur on?

0

10, i removed that part as it does work without it, but then It just moved on to line 11, then 12.

0

One of my weirdest errors ever.

0

Your code is extremely sloppy.

0

Thanks..