View Single Post
01-13-16, 10:59 AM   #2
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,879
Code:
for _,t in pairs(LPSTAT) do 
	if type(t)=='table' then 
		t.Gold = nil 
	end 
end
Essentially looping through a table (LPSTAT) and testing to see if an entry is another table. If it is then setting that tables ["gold"] entry to nil.
Code:
LPSTAT = {
	TableEntry1 = {
		gold=100,
		silver=50,
		copper=10,
	},
	NonTableEntry1 = "Something",
}
If LPSTAT looked something like that then TableEntry1 would have its gold set to nill but NonTableEntry1 would be ignored because it is a string.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 01-13-16 at 11:11 AM.
  Reply With Quote