Give Special Players thier own Playermodel.

Well, yep. This is 2 help posts in 1 days. Sucks . . . I must learn LUA. Anyways.
Me and my friend both thought of the game to give up custom player models when playing the gamemode. If anyone have a sugestion please reply with it. Please don’t troll or say “Learn LUA” I’ve tired a STEAM ID check and this was the outcome.
SORRY FOR THE GIANT IMAGE
Thanks Danny Zee for adding Lyme, xD


if ply:SteamID == STEAM_0:1:******** then
		ply:SetModel ("models\Combine Ghillie\combine_sniper.mdl")
end
if ply:SteamID == STEAM_0:1:******** then
		ply:SetModel ("models\player\alyx.mdl")
end

Are the models in the FastDL so client can download, also is it in the server files,
and is that being called by a function?
example

function FirstSpawn( ply )

if ply:SteamID == STEAM_0:1:******** then
	ply:SetModel ("models\Combine Ghillie\combine_sniper.mdl")

end
end

hook.Add( “PlayerInitialSpawn”, “playerInitialSpawn”, FirstSpawn )

If you put that in init.lua, when they first spawn that wil be there player model, you can change the hook to what ever you need

You forgot an “end” to the “if” statement.
Also, put Lua scripts in [lua ] - [ /lua] tags (without the spaces).
You also don’t need to put Lua stuff in the FastDL.

If your talking about my post, I realized all that and edited my post,

Okay, so I added your code. Now I get this in console.

[ERROR] gamemodes/survivaltown/gamemode/init.lua:30: function arguments expected near ‘==’

EDIT: And it also now sets the model to kleiner.

Make a lua file called “specialchars.lua”
inside that add this

function CheckSpecialCharacters( ply )

if ( ply:SteamID() == "STEAM_0:1:*******" ) then 
	ply:SetModel ("models\Combine Ghillie\combine_sniper.mdl")
end 

end

inside init.lua add this

AddCSLuaFile( “specialchars.lua” )
include( ‘specialchars.lua’ )

function GM:PlayerInitialSpawn( ply )
CheckSpecialCharacters( ply )
end

EDIT: I forgot to change ply:give(“crowbar”) to your model lol

[editline]1st September 2013[/editline]

Any luck?

No Errors, but just a missing model. I tried a custom model (Gillie Suit Combine) then I tried Alyx, but no luck :frowning:
specialchars.lua


function CheckSpecialCharacters( ply )
	if ( ply:SteamID() == "STEAM_0:1:********" ) then 
		ply:SetModel ("models\CombineGhillie\combine_sniper.mdl")
	end
end

init.lua (Just a snippit, I also added the AddCSLua and include.)


function GM:PlayerInitialSpawn( ply )
	print("Player: " .. ply:Nick() .. ", has spawned.")
	CheckSpecialCharacters( ply )
	ply:SetGamemodeTeam( 0 )
end

Oh and just so people know, I’m not retarded. I’m not really using the Steam ID “STEAM_0:1:********”, I’m using my Steam ID.

Here’s the appropriate place to do this: http://wiki.garrysmod.com/page/GM/PlayerSetModel