Need help for my garage gui

So i am trying to make a garage gui but i dont know how i can check if there is some sort of value in the slot before the 3rd slot. so what i am wondering if there is like a way to check if there is a value in the 2nd slot (both of these slots are stringvalues)

if slot3.Value == "" and not slot2.Value then
		local sellcopy = script.Parent.Example_Button_Sell:Clone()
		local spawncopy = script.Parent["Example_Button_Spawn "]:Clone()
		local namecopy = script.Parent.Example_Name:Clone()
			print("a slot is empty")
			sellcopy:Destroy()
			spawncopy:Destroy()
			namecopy:Destroy()
else
	local sellcopy = script.Parent.Example_Button_Sell:Clone()
	local spawncopy = script.Parent["Example_Button_Spawn "]:Clone()
	local namecopy = script.Parent.Example_Name:Clone()

	sellcopy.Name = "Sell_3"
	spawncopy.Name = "Spawn_3"
	namecopy.Name = "Name_3"
	namecopy.Parent = script.Parent
	sellcopy.Parent = script.Parent
	spawncopy.Parent = script.Parent
	namecopy.Visible = true
	sellcopy.Visible = true
	spawncopy.Visible = true

	namecopy.Text = slot3.Value
end
1 Like
if slot2.Value ~= "" then --squiggly returns true if it isn't nil, otherwise set to false
   if slot3.Value ~= "" then

   end
else
-- do something
end

you can use squiggly char to check if it contains a value, if the slot2 isn’t empty then check for the slot3 and it’ll continue to its way, otherwise make it do something else

2 Likes