Hello guys, i've found script on your forum, which replace detective model (from default to custom). And i want to make it for innocent model, but i don't know coding :<<<
Can someone help me?
P.S. I tried "IsActiveInnocent", but it won't work :(
[code]
hook.Add("TTTBeginRound", "BeginRoundDetectiveSkin", function()
for k,v in pairs(player.GetAll()) do
if v:IsActiveDetective() then v:SetModel(Model("your_model.mdl")) end
end
end)
[/code]
[code]
hook.Add("TTTBeginRound", "BeginRoundDetectiveSkin", function()
for k,v in pairs(player.GetAll()) do
if v:GetRole() == ROLE_INNOCENT then v:SetModel(Model("your_model.mdl")) end
end
end)
[/code]
Untested, but is probably right.
You don't want to make it for innocents because then you'd find out who the traitors are from models, so you'll want to do it for everyone
If I recall, there's a table in terrortown's shared.lua in which you can modify what model everyone is randomly assigned, so check there
[QUOTE=Lolcats;45247375][code]
hook.Add("TTTBeginRound", "BeginRoundDetectiveSkin", function()
for k,v in pairs(player.GetAll()) do
if v:GetRole() == ROLE_INNOCENT then v:SetModel(Model("your_model.mdl")) end
end
end)
[/code]
Untested, but is probably right.[/QUOTE]
Thank you! It's working.
Also thank you both for quick answer.