Team Classes

OK I’m scripting one of those "BossFight game modes. It has two teams so far. (the boss, and the players) I have it scripted so that a random player is chosen as the boss every round, but I would like to know how to edit a class per team only. For example, if you were on the “players” team, you would have 100 health, and normal movespeed, spawning with an SMG for example. But if you were on the “boss” team (as in you ARE the boss) then you would start with 2000 health and a “super crowbar”. How would I be able to achieve that? Please help.

You need to use the wiki a lot more, everything is there.

[lua]
function GM:PlayerSpawn(pl)

if pl:Team() == TEAM_BOSS then

 pl:SetHealth(2000)
 pl:Give("weapon_super_crowbar")

elseif pl:Team() == TEAM_PLAYER then

 pl:Give("weapon_smg1")

else

 end

end
[/lua]

the maurits.tv wiki? That wiki doesn’t ever help me.

How come it doesn’t help you? Everything is located there.

No no, I understand the basics of Lua (functions, statements, etc.) but the I cannot find any practical tutorials there.

The functions are documented though, it’s easy to tell that you’re wanting the boss to start the round stronger, and deal more damage. Those two hooks would be PlayerSpawn (shown above), and ScalePlayerDamage ( http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/indexcf68.html ) unless you do have an actual super crowbar swep