Sure here is the explanation.I am making a script which asks some questions ( 7 questions) But so far im using only 2.Whatever the user answers it defined as a variable,The answer variables are 2 answers[1] and answers[5].At the end of the script there is the submit button which makes the consolusion and at the time gives a message.Here are all the IF’s of my script
[lua]
local answers = {}
local sub = vgui.Create ( “DButton” );
sub:SetSize ( 80 , 20)
sub:SetPos (30 , 250)
sub:SetText( “Submit answers” )
sub:SetParent ( window )
sub.DoClick = function ()
if answers[1] == nearsea and answers[5] == metal then
Msg(“Fighting Ship”)
end
if answers[1] == nearsea and answers[5] == wood then
Msg(“Raft”)
end
if answers[1] == nearsea and answers[5] == cement then
Msg(“Sea Base”)
end
if answers[1] == nearland and answers[5] == metal then
Msg(“Armored Tank”)
end
if answers[1] == nearland and answers[5] == wood then
Msg(“Hut”)
end
if answers[1] == nearland and answers[5] == cement then
Msg(“House or Fort”)
end
if answers[1] == intheair and answers[5] == metal then
Msg(“Fighter Plane”)
end
if answers[1] == intheair and answers[5] == wood then
Msg(“Ancient Plane”)
end
if answers[1] == intheair and answers[5] == cement then
Msg(“Skycraper”)
end
if answers[1] == underwater and answers[5] == metal then
Msg(“Submarine”)
end
if answers[1] == underwater and answers[5] == wood then
Msg(“Shipwreck”)
end
if answers[1] == underwater and answers[5] == cement then
Msg(“Underwater base”)
end
end
[/lua]