So, I have been trying to use a custom player model for the detective role in TTT, I am using this script
hook.Add("TTTBeginRound", "BeginRoundDetectiveSkin", function()
for k,v in pairs(player.GetAll()) do
if v:IsActiveDetective() then v:SetModel(Model("police.mdl")) end
end
end)
The model is in models/player/police.mdl
And yet, it is always an error when we look at it.
Any suggestions?
**also, I get this error in the csole
*** ERROR: C_ServerRagdoll::InitModel: police.mdl missing vcollide data ***
"Model" is relative to the model directory, so doing this should work:
EDIT: Looks like I was wrong, turns out it needs "models/" too.
[LUA]
hook.Add( "TTTBeginRound", "BeginRoundDetectiveSkin", function()
for _, ply in pairs( player.GetAll() ) do
if ply:IsActiveDetective() then
ply:SetModel( Model("models/player/police.mdl") )
end
end
end )
[/LUA]
[QUOTE=isnipeu;45368161]"Model" is relative to the model directory, so doing this should work:
[LUA]
hook.Add( "TTTBeginRound", "BeginRoundDetectiveSkin", function()
for _, ply in pairs( player.GetAll() ) do
if ply:IsActiveDetective() then
ply:SetModel( Model("player/police.mdl") )
end
end
end )
[/LUA][/QUOTE]
Still an error.. idk why :(
Because you gotta add the "models/" bit too.
[QUOTE=isnipeu;45368161]"Model" is relative to the model directory, so doing this should work:
[LUA]
hook.Add( "TTTBeginRound", "BeginRoundDetectiveSkin", function()
for _, ply in pairs( player.GetAll() ) do
if ply:IsActiveDetective() then
ply:SetModel( Model("player/police.mdl") )
end
end
end )
[/LUA][/QUOTE]
I also tried doing player/alyx.mdl , to make sure its not the model. Still an error. This is making me think the script is messed up.
[editline]12th July 2014[/editline]
[QUOTE=Robotboy655;45368264]Because you gotta add the "models/" bit too.[/QUOTE]
Doesnt the "Model" part of the script already take care of that? ...
[editline]12th July 2014[/editline]
[QUOTE=Robotboy655;45368264]Because you gotta add the "models/" bit too.[/QUOTE]
Derp. Thanks alot! It works!
Sorry, you need to Log In to post a reply to this thread.