Ulysses

General => Developers Corner => Topic started by: Prince_Llamacorn on May 08, 2014, 02:59:25 PM

Title: Player model changer
Post by: Prince_Llamacorn on May 08, 2014, 02:59:25 PM
I've been searching for a while but i can't figure out how to make a player model changer command could someone help
(I'm new)
Title: Re: Player model changer
Post by: JamminR on May 08, 2014, 04:05:30 PM
See Cobalt's commands here.
http://forums.ulyssesmod.net/index.php/topic,7268.0/ (http://forums.ulyssesmod.net/index.php/topic,7268.0/)
One of the many is "ulx model"
Title: Re: Player model changer
Post by: Prince_Llamacorn on May 08, 2014, 04:19:05 PM
Thanks :3
Title: Re: Player model changer
Post by: MrPresident on May 08, 2014, 10:53:00 PM
Essentially you do it with two functions:

First you need to translate the player model ( unless you know the exact path to the model you want)
To do this, Use: player_manager.TranslatePlayerModel( modelname ) (http://"http://wiki.garrysmod.com/page/player_manager/TranslatePlayerModel")

Once you have the model path, just use entity:SetModel( model ) like you would with anything else.
Player:SetModel( model ) (http://"http://wiki.garrysmod.com/page/Entity/SetModel")

^^ The links take you to relevant wiki articles. ^^


EXAMPLE:

(in this example, ply is the player entity. I will assume you already know what that is and how to use it)

Code: [Select]
local pmodel = player_manager.TranslatePlayerModel( "alyx" )
ply:SetMode( pmodel )
Title: Re: Player model changer
Post by: Bite That Apple on May 08, 2014, 11:14:13 PM
I don't have too much time, but you might be able to get an idea of an addon I made a while back:
http://forums.ulyssesmod.net/index.php/topic,6184 (http://forums.ulyssesmod.net/index.php/topic,6184)