Attempt to concatenate string with Instance

Whenever i purchase the slot it says “attempt to concatenate string with Instance” how can i fix it??

	local PurchasedSlots = Instance.new("NumberValue", player)
			PurchasedSlots.Name = "PurchasedSlots"
			PurchasedSlots.Value = profile.Data.PurchasedSlots
			PurchasedSlots:GetPropertyChangedSignal("Value"):Connect(function()
				profile.Data.PurchasedSlots = PurchasedSlots.Value
				player.PlayerGui.MainMenu.Main.PurchaseSlot.Visible = false
				local Slots = 0
				for _,Slot in pairs(player.PlayerGui.MainMenu.Main:GetChildren()) do
					if string.find(Slot.Name, "Slot") and Slot:IsA("ImageButton") and Slot.Name ~= "TemplateSlot" and Slot.Name ~= "PurchaseSlot" then
						Slots += 1
					end
				end
				if PurchasedSlots.Value == Slots + 1 then
					local NewSlotFolder = Instance.new("Folder", player)
					NewSlotFolder.Name = "DataSlot"..PurchasedSlots ---lINE THAT ERRORS----

Seems like PurchasedSlots is an instance, try doing PurchasedSlots.Value

Well dang lol i had that before it never worked but all of a sudden it works now thanks

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.