I need help for my script Clothing Store

Hello everyone,

I would need 2 or 3 small aids on the script I’m creating.

Here is a picture to show you how it looks:

I explain to you:
What function should I use so that when I press the “>>” and “<<” buttons it changes the player model in the menu from this list: models/player/suits/male_01_closed_coat_tie.mdl, models/player/suits/male_01_open.mdl, models/player/suits/male_01_open_tie.mdl, models/player/suits/male_01_shirt.mdl, models/player/suits/male_01_shirt_tie.mdl.

My code:


function dermadescs()

local ply=LocalPlayer()
local frame = vgui.Create( "DFrame" )
frame:SetSize( 300, 400 )
frame:Center()
frame:SetTitle( "Clothing Store" )
frame:MakePopup()

local icon = vgui.Create( "DModelPanel", frame )
icon:SetSize( 350, 350 )
icon:SetPos(-30, 8)
icon:SetModel( "models/player/alyx.mdl" )

local DermaButton = vgui.Create( "DButton" )
DermaButton:SetParent( frame ) -- Set parent to our "frame"
DermaButton:SetText( "<<" )
DermaButton:SetPos( 10, 350 )
DermaButton:SetSize( 60, 20)
DermaButton.DoClick = function ()
    icon:SetModel() -- Wath the function ?
end

local DermaButton = vgui.Create( "DButton" )
DermaButton:SetParent( frame ) -- Set parent to our "frame"
DermaButton:SetText( ">>" )
DermaButton:SetPos( 230, 350 )
DermaButton:SetSize( 60, 20)
DermaButton.DoClick = function ()
    icon:SetModel() -- Wath the function ?
end

local DermaButton = vgui.Create( "DButton" )
DermaButton:SetParent( frame ) -- Set parent to our "frame"
DermaButton:SetText( "Buy (100$)" )
DermaButton:SetPos( 115, 350 )
DermaButton:SetSize( 60, 20)
DermaButton.DoClick = function (ply, cmd, args )

	LocalPlayer():SetModel(icon:GetModel())

end



end
concommand.Add("clothstore", dermadescs)

Sorry for my English. I am french.

Just make a table with those values in it, then use the modulus operator to go back and forward between values in the table

Well, you have made a start. Still have a while to go. I am assuming you are trying to achieve something similar to the one in PERP.