Jump to content

Help with loop


#Hulk

Recommended Posts

Hello , I need help with this code please ,

wrong in line 4 :

Bad argument #1 to 'pairs' (table expected, got number)


 
local factionTable = getElementData(getLocalPlayer(), "faction")
		local organizedTable = {}
		
		for i, k in pairs(factionTable) do													
		 organizedTable[k] = i
		end
		
		--#Hulk
		for k, id in ipairs(organizedTable) do
			if id ~= factionID then
				ftab[id] = guiCreateTab(getFactionName(id), ftabs)
				setElementData(ftab[id], "factionID", id)
				addEventHandler("onClientGUITabSwitched", ftab[id], loadFaction, false)	
		end
	end	

 

Edited by #Hulk
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...