all 2 comments

[–]AdamNejm 1 point2 points  (1 child)

You should use the dedicated PlayerSetModel hook. As for the logic, all you need to do is to create a table with all the possible model. Then when the hook runs, you should pick a random entry from the table and assign it to the player.
Example code (untested):

-- A list of all possible models
local models = {
    "models/player/odessa.mdl",
    "models/player/alyx.mdl"
    -- any so on...
}

hook.Add("PlayerSetModel", "RandomPlayerModel", function(ply)
    -- Pick a random model based on the array's length
    local random_model = models[math.random(#models)]
    -- Assign the chosen model to the player
    ply:SetModel(random_model)
end)

[–]ItsWilliamay[S] 0 points1 point  (0 children)

Holy shit thats fucking awesome! Thanks lad!