spawngod_time = 5000 -- 5000ms = 5s

addhook("spawn","spawn_god")
function spawn_god(id)
	USERTEMP[id]["spawnms"] = Millisecs()
	msgc2(id, "You're in god mode for "..math.floor(spawngod_time/1000).." seconds", 0, 255, 0)
end

function spawn_godhit(id)
	if Millisecs() - USERTEMP[id]["spawnms"] <= spawngod_time then
		return 1
	end
end
CreateHitAttachment(spawn_godhit)