why this no working?

hey i just strated the lua language and how do i do lua i dont understant the lua langauge

if player has a physgun then make him god

why this no work?
i want player that hold physgun be infinite health

strange, that code works for me. are you sure that you aren’t using an outdated version of gmod?

you forgot the ‘end’.


There will be more to it than that but yeah

for k,Player in pairs( player.GetAll() ) do

if( Player:GetActiveWeapon() == "weapon_physgun" ) then
    Player:GodEnable( true )
    Player:GodEnable( false )


Probably something wrong with that, but yeah, be a dirty fucker and chuck it in a think hook, serverside.

Typed on facepunch so it looks like aids with the tabbing and that.