function onClicked(player)
	local item = game.ServerStorage.Items.Logs:Clone()
	local gui = player.PlayerGui.ScreenGui.MainGui.Guis.Backpack
	if gui.B1.Used.Value == nil then
		item.Parent = gui.B1
		item.Parent.Image = game.ServerStorage.Items.Logs.ItemPic.Value
		item.Parent.Used.Value = "Logs"
	end
	if gui.B1.Used.Value ~= nil and gui.B2.Used.Value == nil then
		item.Parent = gui.B2
		item.Parent.Image = game.ServerStorage.Items.Logs.ItemPic.Value
		item.Parent.Used.Value = "Logs"
	end
	if gui.B1.Used.Value ~= nil and gui.B2.Used.Value ~= nil then
	end
	print("Nil")
end

script.Parent.Model.Root.ClickDetector.MouseClick:connect(onClicked)

So, basically the used value is nil and it's still just going all the way through and printing "nil" anyway to make this work?

3 comments

0

It's printing Nil because the print function is outside of all the if statements. Might I also suggest using elseif rather than creating a new if then statement each time?

0

Not to ask for too much of you, but mind writing it out? I've tried elseif statements also but they wouldn't work.

0

Just instead of the end and if on lines 8 and 9, put elseif on line 9 and delete the end. Same for lines 13 and 14.