• black character
    6 replies, posted
Hi! ive almost finished my gamemode but i noticed another problem... my character (player model) is black, any help? theres no errors or anything in console [IMG]http://i.share.pho.to/d93a245a_o.png[/IMG] i would love some help, thanks Guys!
Any code? That's player.mdl and it's a fallback when no other playermodel has been set.
You need to assigned a player model to both teams...
this is my init.lua file [CODE]function GM:PlayerSpawn( ply ) ply:SetModel("models/player/group01/male_07.mdl") ply:GiveGamemodeWeapons() LocalPlayer():AddEnergy( 100 ) end[/CODE]
Not sure why you're using a combination of ply and LocalPlayer() in serversided code (where LocalPlayer() does not exist because the server is not a player)
As I went over just a little bit ago in [url=http://facepunch.com/showthread.php?t=1454586&p=47272892&viewfull=1#post47272892]your other thread,[/url] you don't need to (and can not) use LocalPlayer() there because A) The player object is already supplied for you (ply) and B) PlayerSpawn is serverside only
When you overwrite PlayerSpawn, be sure to also set up PlayerSetModel and PlayerLoadout hooks. Take a look at how this does it: [url]https://dl.dropboxusercontent.com/u/26074909/tutoring/_systems/spectating_players_system.lua.html[/url] PlayerSetModel is where you set the player-model and PlayerLoadout is where you give weapons. You're also calling LocalPlayer( ) in a SERVERside hook ( if you're not getting errors, it's because the code is on the client-side and is NOT being executed at all ). Make sure PlayerSpawn is SERVERside.
Sorry, you need to Log In to post a reply to this thread.