Mr. Gash's Deathrun | Setting death model, and weapon.

Hello, I was wondering what I could do to have the players on the death team, set a certain model regardless of there point shop model. I was also wondering how to replace the death’s crowbar, with another weapon.

In the PlayerSpawn hook in a timer, set the model and ViewModel of the player.

It goes back to the pointshop one, right after I spawn.

Post your code.

timer.Simple( 1, function()
if ply:Team()== TEAM_DEATH then
ply:SetModel( “models/grim.mdl” )
end

I’m not very coding smart, so there is an extremely high chance that this is bad.

Then make it using a timer. In my gamemode I using this code:


timer.Simple(2.5, function() ply:SetModel(CLASS.PlayerModel) end)

(for fretta, goes in player class lua file)

Is that in a hook?

[editline]5th March 2016[/editline]

Deathrun has no player classes

Pointshop uses 1-second timer, so there is a chance that Pointshop’s timer will run after yours and this will not work. I recommend using 2.5-seconds timer.

[editline]6th March 2016[/editline]

I know. Adaptation isn’t so hard - just change “CLASS.PlayerModel” to yours model, and add “if” like Texas_on_duty said.

Alright! Thank you guys, 2.5 worked. Now I need to try the weapon change. :wink:

[editline]5th March 2016[/editline]

function GM:PlayerLoadout( ply )

if ply:Team() == TEAM_RUNNER then
	ply:Give("weapon_crowbar")
elseif ply:Team()== TEAM_DEATH then
	ply:Give("custom_weapon")

end

Would that work?

Only if there’s not multiple instances of PlayerLoadout in the gamemode.