Job Setup

I wanted to know how are you able to make a certain job have God Mode?
Thank You.

Here’s as short as it gets…

// Configuration Table.
local GOD_MODE_TEAMS = {
[ TEAM_ADMIN ] = true; – If your team CONSTs are ids, which is in 99% of game-modes, then use this line, otherwise comment it out. ( Crime City, TTT, DarkRP, etc )
– TEAM_ADMIN = true; – If your teams are STRINGs, rare, then uncomment this line. ( Unknown )

hook.Add( “PlayerShouldTakeDamage”, “TeamGodMode”, function( _victim, _attacker )
// If the victim is a valid entity, and is a player, and they’re on a team that shouldn’t take damage
if ( IsValid( _victim ) && _victim:IsPlayer( ) && GOD_MODE_TEAMS[ _victim:Team( ) ] ) then
// Prevent them from taking damage
return false;
end );[/lua]

Modified from this idea:

Here is this example written in the same way with the helpful comments:

Okay, thank you. I put this within the jobs.lua file correct?

Nope; put it in


Make sure you add your teams to the list following the pattern.

I don’t have a godmode_teams.lua.

[editline]1st June 2014[/editline]

In lua/autorun/server, I have forcedownload.lua and admin_functions.lua

Create those folders and then put it there.

Here, zipped; extract to your SERVER garrysmod/addons folder in a way that this path exists: garrysmod/addons/acecool/lua/autorun/server/godmode_teams.lua

Okay, extracted and imputed. I now don’t need to add


[editline]1st June 2014[/editline]

I edited like this which I doubt is correct, is it?