A problem with IF conditions..

Alright so here’s my problem.
I have a table which I extract something from, then use IF to see what it matches.
No errors and it jumps to ELSE unless I don’t have it, in which case it says AFac is nil.

local PFac = RPFactions.GetPlayerInfo(ply)
local IFac = PFac.factionid

print(IFac) --for debug purposes, it indeed shows the correct “factionid”. I thought it may be a problem with the fact I’m extracting it from a table, but I guess not since Print prints it just fine.
if IFac == 1 then
AFac = “One”
elseif IFac == 2 then
AFac = “Two”
elseif IFac == 3 then
AFac = “Three”
else – even though there’s no way I can think of this being triggered, I put it in just to avoid “is nil” errors.
AFac = “None”
print(AFac) – for debug purposes, somewhy it sets AFac as None.

Any ideas?

Are you certain that the value is a number and not a string for some reason?

Scratch that, somewhy it works now when I put in quotes but didn’t before.