NWString's clearing between functions

In short, when the “Type:” is printed here, it is displayed as a value. When it is printed in the console command it comes up as “”. No other functions are being run that modify FactionCreateType, or FactionType.

[lua]
function GetCreateFactionType(ply, cmd, args)
print(ply:GetNWString(“FactionCreateType”))
end
concommand.Add(“TTCRP_Sync”, GetCreateFactionType)
[/lua]

[lua]
local Confirm = vgui.Create( “DButton” )
Confirm:SetParent( DermaList )
Confirm:SetText( “Create Faction - Price: $500” )
Confirm:SetPos( DermaList:GetWide() - DermaList:GetWide() + 10, DermaList:GetTall() - 30 )
Confirm:SetSize( DermaList:GetWide() - 20, 20 )
Confirm.DoClick = function ()
if(client:GetNWString(“FactionCreateType”) == “”) then client:PrintMessage(HUD_PRINTTALK, “Choose a faction type!”) return false end
if(client:GetNWString(“FactionCreateName”) == “”) then client:PrintMessage(HUD_PRINTTALK, “Choose a faction name!”) return false end
client:SetNWString(“FactionType”, client:GetNWString(“FactionCreateType”))
print("Type: "…client:GetNWString(“FactionCreateType”))
RunConsoleCommand(“TTCRP_Sync”)
end
[/lua]

If you set a Networked variable clientside (as you are there) it will only update clientside. You need to set it serverside for it to change on both the server and the client.

Odd, I wouldn’t think you could set a client sided variable that way. Anyway, I’ve configured all my code and it works, for the most part anyways. For some reason both Criminal and Law Enforcement are using the Criminal’s color, when I change Law Enforcement to 2, and Criminal to 3 it uses Law Enforcement’s color.
[lua]
team.SetUp(1,“Citizen”,Color(0,180,0,255))

team.SetUp(2,“Criminal”,Color(100,100,100,255))

team.SetUp(3,“LawEnforcement”,Color(0,0,180,255))
[/lua]

This function is ran when they hit a confirm button.
[lua]
function GetCreateFactionType(ply, cmd, args)
ply:SetNWString(“FactionName”, ply:GetNWString(“FactionCreateName”))
ply:SetNWString(“FactionType”, ply:GetNWString(“FactionCreateType”))

if( ply:GetFaction() == "Citizen") then
	ply:SetTeam(1)
end

if( ply:GetFaction() == "Criminal") then
	ply:SetTeam(2)
end

if( ply:GetFaction() == "Law Enforcement") then
	ply:SetTeam(3)
end

end
concommand.Add(“TTCRP_Sync”, GetCreateFactionType)
[/lua]